Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:05 AM
Ian Collins
 
Posts: n/a
Default HPUX out of memory errors - kernel tuning?

Hi,
I have a HP rp3410 with 4Gb RAM running HPUX 11.11. This is running,

Version: '5.0.26-pro-log' socket: '/tmp/mysql.sock' port: 3306 MySQL
Pro (Commercial)

When this machine is put under load (i.e, a lot of database activity),
the clients are receiving "Error 12" errors and the MySQL log has a lot
of errors as follows,

070327 8:24:20 [ERROR] mysql_ha_read: Got error 12 when reading table
'XLDEFN_IN'
070327 8:54:51 [ERROR] mysql_ha_read: Got error 12 when reading table
'XLDEFN_IN'
070327 8:55:19 [ERROR] mysql_ha_read: Got error 12 when reading table
'XLDEFN_IN'

In addition, I see at MySQL startup (in the mysql err log), a number of,

/usr/local/mysql/bin/mysqld: Out of memory (Needed 368389120 bytes)
/usr/local/mysql/bin/mysqld: Out of memory (Needed 276289536 bytes)


My /etc/my.cnf is set as,

[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
set-variable = key_buffer_size=400M
set-variable = max_allowed_packet=15M
default-table-type=InnoDB
datadir=/data/mysql

The machine is indicating it is under any ram pressure, which makes me
think it may be kernel tuning (of course, I may be wrong). Are there any
recommendations for HPUX kernel tuning with MySQL?

--

Regards,
Ian Collins
Systems Manager
KIWIPLAN Group
Tel: +64 (0)9 2727622
Mob: +64 (0)21 761144


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:05 AM
Lucas.CTR.Heuman@faa.gov
 
Posts: n/a
Default Using replace with New Lines

Hello Group,

Looking to use this REPLACE to strip multi line data out of my return
data.

I am having problems getting the \n to work correctly, any ideas?

REPLACE(DESCRIPTION,\n,' ')


SELECT
rpad(CASE WHEN DESCRIPTION IS NULL THEN '' ELSE
REPLACE(DESCRIPTION,'\n',' ') END,80,' ') as var
FROM hardware;



Wishing you the best you know you deserve,

______________________
Lucas Heuman
CM Web Developer
SRA International, Inc.
FAA, WJHTC/Bldg 300, 2nd Fl., H33
Atlantic City Int'l Airport, NJ 08405
Phone 609.485.5401
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 06:05 AM
Lucas.CTR.Heuman@faa.gov
 
Posts: n/a
Default Re: Using replace with New Lines

Ok.. I found the problem.. I needed to add a \r.. but now that opens up
the question can I have a Multi replace search in replace?


Example can I do something like this in MySQL

REPLACE (STRING,'\r' or '\n',' ')


REPLACE(DESCRIPTION,'\r\n',' ')

Wishing you the best you know you deserve,

______________________





Hello Group,

Looking to use this REPLACE to strip multi line data out of my return
data.

I am having problems getting the \n to work correctly, any ideas?

REPLACE(DESCRIPTION,\n,' ')


SELECT
rpad(CASE WHEN DESCRIPTION IS NULL THEN '' ELSE
REPLACE(DESCRIPTION,'\n',' ') END,80,' ') as var
FROM hardware;



Wishing you the best you know you deserve,

______________________
Lucas Heuman
CM Web Developer
SRA International, Inc.
FAA, WJHTC/Bldg 300, 2nd Fl., H33
Atlantic City Int'l Airport, NJ 08405
Phone 609.485.5401

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 06:05 AM
Stephen Cook
 
Posts: n/a
Default Re: Using replace with New Lines

I always go with REPLACE(REPLACE(STRING, '\n', ''), '\r', ''), since
depending on where your data came from there may be one or the other, or
both. Although if there is a shorthand/more efficient way I'd love to
hear it.


Lucas.CTR.Heuman@faa.gov wrote:
> Ok.. I found the problem.. I needed to add a \r.. but now that opens up
> the question can I have a Multi replace search in replace?
>
>
> Example can I do something like this in MySQL
>
> REPLACE (STRING,'\r' or '\n',' ')
>
>
> REPLACE(DESCRIPTION,'\r\n',' ')
>
> Wishing you the best you know you deserve,
>
> ______________________
>
>
>
>
>
> Hello Group,
>
> Looking to use this REPLACE to strip multi line data out of my return
> data.
>
> I am having problems getting the \n to work correctly, any ideas?
>
> REPLACE(DESCRIPTION,\n,' ')
>
>
> SELECT
> rpad(CASE WHEN DESCRIPTION IS NULL THEN '' ELSE
> REPLACE(DESCRIPTION,'\n',' ') END,80,' ') as var
> FROM hardware;
>
>
>
> Wishing you the best you know you deserve,
>
> ______________________
> Lucas Heuman
> CM Web Developer
> SRA International, Inc.
> FAA, WJHTC/Bldg 300, 2nd Fl., H33
> Atlantic City Int'l Airport, NJ 08405
> Phone 609.485.5401
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 06:05 AM
Brown, Charles
 
Posts: n/a
Default a Linux -csh script to refresh test with production


Hello all.

Does anyone out there (in mysql world) have a Linux -csh script to
refresh test with production data.

My developers would like their test database to be refreshed nightly
with production data. The production and test mysql servers do not run
in the same box. They run on different boxes. Therefore there is some
ftp or scp required

Thanks

********************************************
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.
********************************************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 06:05 AM
Rolando Edwards
 
Posts: n/a
Default Re: a Linux -csh script to refresh test with production

If test and production are supposed to be identical, then use this:

mysqldump -h<IP for Prod> -u... -p... --triggers --routines <db-name on Prod> | mysql -h<IP for Test> -u... -p... -A -D<db-name on Test>

If you havn't noticed, you do not dump the data to a file and ftp or scp anything anywhere !!!
This will actually pipe all mysqldump commands striaght to the test database.

Make sure Linux can withstand the long connect time required.

If you want mysqldump all tables one at a time,
here is a Windows Batch File That I Use Every Week:

1) drop a target database,
2) recreate a target database,
3) Copy all stored procedures from Source to Target
4) Dynamically Create a Windows Batch File to mysqldump every table
(and its triggers, if applicable) starting with the largest table

Using this method, you need not worry about connection time because each table
will be shipped over from Source to Target using a Fresh Connection each time.

@echo off
set TABLESBAT=DynamicBatchFile.bat
echo SysData Full Copy Initiated > DataLoadFull.txt
date /t >> DataLoadFull.txt
time /t >> DataLoadFull.txt
rem
rem
rem Drop SysData_Test from Target
rem Create SysData_Test for Target
rem Load Stored Procedures from Host PROD_IP Database SysData_Prod into Host TEST_IP Database SysData_Test
rem
rem
set SOURCE_HOST=PROD_IP
set SOURCE_USER=...
set SOURCE_PASS=...
set TARGET_HOST=TEST_IP
set TARGET_USER=...
set TARGET_PASS=...
rem
rem
echo DROP DATABASE IF EXISTS SysData_Test; > ResetTarget.sql
echo CREATE DATABASE SysData_Test; >> ResetTarget.sql
echo USE SysData_Test >> ResetTarget.sql
mysqldump -h%SOURCE_HOST% -u%SOURCE_USER% -p%SOURCE_PASS% --no-data --no-create-info --routines NDW >> ResetTarget.sql
rem
rem
rem mysqldump all MyISAM tables from Source to Target in Size Order starting from the Largest Table
rem
rem
mysql -h%SOURCE_HOST% -u%SOURCE_USER% -p%SOURCE_PASS% -A --skip-column-names -DNDW -e"SELECT CONCAT('mysqldump -h%SOURCE_HOST% -u%SOURCE_USER% -p%SOURCE_PASS% --triggers SysData_Prod ',A.table_name,' | mysql -h%TARGET_HOST% -u%TARGET_USER% -p%TARGET_PASS% -A -DSysData_Test') FROM (SELECT table_name,(data_length+index_length) table_length FROM information_schema.tables WHERE table_schema='SysData_Prod' AND engine='MyISAM') A ORDER BY A.table_length DESC,A.table_name;" >> %TABLESBAT%
echo exit >> %TABLESBAT%
mysql -h%TARGET_HOST% -u%TARGET_USER% -p%TARGET_PASS% -A < ResetTarget.sql
start "mysqldumps from PROD to TEST, DO NOT CLOSE !!!" /w %TABLESBAT%
del ResetTarget.sql
del %TABLESBAT%
echo SysData Full Completed >> DataLoadFull.txt
date /t >> DataLoadFull.txt
time /t >> DataLoadFull.txt

PLEASE BE CAREFUL WITH THIS !!!

----- Original Message -----
From: "Charles Brown" <CBrown@BMI.com>
To: mysql@lists.mysql.com
Sent: Tuesday, March 27, 2007 3:17:46 PM (GMT-0500) Auto-Detected
Subject: a Linux -csh script to refresh test with production


Hello all.

Does anyone out there (in mysql world) have a Linux -csh script to
refresh test with production data.

My developers would like their test database to be refreshed nightly
with production data. The production and test mysql servers do not run
in the same box. They run on different boxes. Therefore there is some
ftp or scp required

Thanks

********************************************
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.
********************************************

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=redwards@swmx.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-28-2008, 06:05 AM
Bessares, Bob
 
Posts: n/a
Default RE: a Linux -csh script to refresh test with production


well, you'd want to come up with your specifics but it's pretty simple using ssh...
put this is your shell...

$ mysqldump db-name | mysql -h remote.box.com db-name

$ mysqldump db-name | ssh user@remote.box.com mysql db-name

$ mysqldump db-name foo | ssh user@remote.box.com mysql bar

hope this helps
bb


-----Original Message-----
From: Brown, Charles [mailto:CBrown@BMI.com]
Sent: Tue 3/27/2007 12:17 PM
To: mysql@lists.mysql.com
Subject: a Linux -csh script to refresh test with production


Hello all.

Does anyone out there (in mysql world) have a Linux -csh script to
refresh test with production data.

My developers would like their test database to be refreshed nightly
with production data. The production and test mysql servers do not run
in the same box. They run on different boxes. Therefore there is some
ftp or scp required

Thanks

********************************************
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.
********************************************

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=b...es@latimes.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-28-2008, 06:08 AM
Mathieu Bruneau
 
Posts: n/a
Default Re: HPUX out of memory errors - kernel tuning?

Ian Collins a écrit :
> Hi,
> I have a HP rp3410 with 4Gb RAM running HPUX 11.11. This is running,
>
> Version: '5.0.26-pro-log' socket: '/tmp/mysql.sock' port: 3306 MySQL
> Pro (Commercial)
>
> When this machine is put under load (i.e, a lot of database activity),
> the clients are receiving "Error 12" errors and the MySQL log has a lot
> of errors as follows,
>
> 070327 8:24:20 [ERROR] mysql_ha_read: Got error 12 when reading table
> 'XLDEFN_IN'
> 070327 8:54:51 [ERROR] mysql_ha_read: Got error 12 when reading table
> 'XLDEFN_IN'
> 070327 8:55:19 [ERROR] mysql_ha_read: Got error 12 when reading table
> 'XLDEFN_IN'
>
> In addition, I see at MySQL startup (in the mysql err log), a number of,
>
> /usr/local/mysql/bin/mysqld: Out of memory (Needed 368389120 bytes)
> /usr/local/mysql/bin/mysqld: Out of memory (Needed 276289536 bytes)
>
>
> My /etc/my.cnf is set as,
>
> [client]
> port=3306
> socket=/tmp/mysql.sock
>
> [mysqld]
> port=3306
> socket=/tmp/mysql.sock
> set-variable = key_buffer_size=400M
> set-variable = max_allowed_packet=15M
> default-table-type=InnoDB
> datadir=/data/mysql
>
> The machine is indicating it is under any ram pressure, which makes me
> think it may be kernel tuning (of course, I may be wrong). Are there any
> recommendations for HPUX kernel tuning with MySQL?
>


Hi,
You probably figured that out by now, but for the book.

You're probably using a 32 bits architecture and then are limited to 4GB
total memory allocation. That being said, that's the maximum you can
have, but the kernel reserved a certain value for it's stack and other
part. Depending of the os, it reserved from 800-2G. For example, many
linuxes cannot go over 2.2Gb without seeing those errors.

I'm not very familiar with HP-UX, so you may find parameter to tweak to
increase that value that you can allocate, but I doubt you could get
more than 3Gb so you may want to decrease your mysql settings so it
doesn't allow that much memory...

Example you set key_buffer_size to 400M, but default table to innodb. SO
if you don't have much myisam table you can reduce that to a much lower
value (say 100M?)

Or you can also decrease the per thread buffer, and limit the
max_connection settings...

I'm sure you could find a lot more info around on the net! This
http://www.mysqlperformanceblog.com/...-memory-usage/
also gives a few pertinent information.

If all the memory are needed and you wish to increase those esttings, I
advice to consider a 64 Bits architecture as the next upgrade Should
really help with db is starting to get tight in a 32bits one!

Good luck!

--
Mathieu Bruneau
aka ROunofF

===
GPG keys available @ http://rounoff.darktech.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696