Jump to content

Recommended Posts

Posted

Dear George,

Are you running MySQL on Linux or a variety of MS? Is the forum software running on the same server as MySQL?

The reason I asked is that I admin a fairly busy vBulletin-MySQL technical forum that runs (together) on Linux and we don't get these 'MySQL connect limit' errors.

Yours sincerely,

Mr. Farang

Posted

We are running Linux on a dedictated fat machine, MySQL database runs on the same machine. We are having some trouble when the nightly backup starts/ends and the Cpanel is upgraded nightly. Our uptime is over 99%, http://www.thaivisa.net/ so we are talking downtime a few minutes per night. I wish I had a solution to this, maybe you have?

Posted
We are running Linux on a dedictated fat machine, MySQL database runs on the same machine. We are having some trouble when the nightly backup starts/ends and the Cpanel is upgraded nightly. Our uptime is over 99%, http://www.thaivisa.net/ so we are talking downtime a few minutes per night. I wish I had a solution to this, maybe you have?

Dear Khun George,

Without having visability into the process table and load average, my first suggestion would be to try to "nice" the backup task (command) to a lower scheduling priority:

NICE(1)                        FSF                        NICE(1)

NAME

      nice - run a program with modified scheduling priority

SYNOPSIS

      nice [OPTION]... [COMMAND [ARG]...]

DESCRIPTION

      Run  COMMAND with an adjusted scheduling priority.  With no COMMAND, print the current

      scheduling priority.  ADJUST is 10 by default.  Range goes from -20 (highest priority)

      to 19 (lowest).

      -ADJUST

              increment priority by ADJUST first

      -n, --adjustment=ADJUST

              same as -ADJUST

      --help display this help and exit

      --version

              output version information and exit

Posted

We are running incremental backup, so I believe it's very nicely. I will forward your advise to our hostmaster. Further suggestions welcomed!Cheers!

Posted (edited)
We are running incremental backup, so I believe it's very nicely. I will forward your advise to our hostmaster. Further suggestions welcomed!Cheers!

Dear George,

Even incremental backups can use a lot of CPU, so let's say the incremental command was:

/usr/local/bin/inc_backup

Then this command would lower the scheduling priority of the backup:

nice -n 19 /usr/local/bin/inc_backup

And when MySQL is executed, it can be make to run at a higher scheduling priority:

nice -n -20 /usr/local/mysql/bin/safe_mysql (for example)

Please post the output of the command:

cat /proc/cpuinfo

and also:

cat /proc/meminfo   (during the backup, preferably)

Yours sincerely,

Mr. Farang

Edited by Mr. Farang
Posted
cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 5
cpu MHz         : 2400.167
cache size      : 512 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4784.12

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 5
cpu MHz         : 2400.167
cache size      : 512 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4797.23

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 5
cpu MHz         : 2400.167
cache size      : 512 KB
physical id     : 3
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4797.23

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 5
cpu MHz         : 2400.167
cache size      : 512 KB
physical id     : 3
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4797.23

Posted
cat /proc/meminfo
       total:    used:    free:  shared: buffers:  cached:
Mem:  2113945600 2064744448 49201152        0 274599936 1398931456
Swap: 1077501952 158281728 919220224
MemTotal:      2064400 kB
MemFree:         48048 kB
MemShared:           0 kB
Buffers:        268164 kB
Cached:        1257104 kB
SwapCached:     109040 kB
Active:        1509120 kB
ActiveAnon:     317808 kB
ActiveCache:   1191312 kB
Inact_dirty:        40 kB
Inact_laundry:  300504 kB
Inact_clean:     35840 kB
Inact_target:   369100 kB
HighTotal:     1179584 kB
HighFree:        19984 kB
LowTotal:       884816 kB
LowFree:         28064 kB
SwapTotal:     1052248 kB
SwapFree:       897676 kB
-jailshell-2.05b$ cat /proc/meminfo
       total:    used:    free:  shared: buffers:  cached:
Mem:  2113945600 2064744448 49201152        0 274599936 1398931456
Swap: 1077501952 158281728 919220224
       total:    used:    free:  shared: buffers:  cached:
Mem:  2113945600 2044329984 69615616        0 274677760 1398939648
Swap: 1077501952 158281728 919220224
MemTotal:      2064400 kB
MemFree:         67984 kB
MemShared:           0 kB
Buffers:        268240 kB
Cached:        1257112 kB
SwapCached:     109040 kB
Active:        1485676 kB
ActiveAnon:     294284 kB
ActiveCache:   1191392 kB
Inact_dirty:        24 kB
Inact_laundry:  300500 kB
Inact_clean:     35864 kB
Inact_target:   364412 kB
HighTotal:     1179584 kB
HighFree:        39864 kB
LowTotal:       884816 kB
LowFree:         28120 kB
SwapTotal:     1052248 kB
SwapFree:       897676 kB
-jailshell-2.05b$         total:    used:    free:  shared: buffers:  cached:
-jailshell: total:: command not found
-jailshell-2.05b$ Mem:  2113945600 2064744448 49201152        0 274599936 1398931456
-jailshell: Mem:: command not found
-jailshell-2.05b$ Swap: 1077501952 158281728 919220224
-jailshell: Swap:: command not found
-jailshell-2.05b$ MemTotal:      2064400 kB
-jailshell: MemTotal:: command not found
-jailshell-2.05b$ MemFree:         48048 kB
-jailshell: MemFree:: command not found
-jailshell-2.05b$ MemShared:           0 kB
-jailshell: MemShared:: command not found
-jailshell-2.05b$ Buffers:        268164 kB
-jailshell: Buffers:: command not found
-jailshell-2.05b$ Cached:        1257104 kB
-jailshell: Cached:: command not found
-jailshell-2.05b$ SwapCached:     109040 kB
-jailshell: SwapCached:: command not found
-jailshell-2.05b$ Active:        1509120 kB
-jailshell: Active:: command not found
-jailshell-2.05b$ ActiveAnon:     317808 kB
-jailshell: ActiveAnon:: command not found
-jailshell-2.05b$ ActiveCache:   1191312 kB
-jailshell: ActiveCache:: command not found
-jailshell-2.05b$ Inact_dirty:        40 kB
-jailshell: Inact_dirty:: command not found
-jailshell-2.05b$ Inact_laundry:  300504 kB
-jailshell: Inact_laundry:: command not found
-jailshell-2.05b$ Inact_clean:     35840 kB
-jailshell: Inact_clean:: command not found
-jailshell-2.05b$ Inact_target:   369100 kB
-jailshell: Inact_target:: command not found
-jailshell-2.05b$ HighTotal:     1179584 kB
-jailshell: HighTotal:: command not found
-jailshell-2.05b$ HighFree:        19984 kB
-jailshell: HighFree:: command not found
-jailshell-2.05b$ LowTotal:       884816 kB
-jailshell: LowTotal:: command not found
-jailshell-2.05b$ LowFree:         28064 kB
-jailshell: LowFree:: command not found
-jailshell-2.05b$ SwapTotal:     1052248 kB
-jailshell: SwapTotal:: command not found
-jailshell-2.05b$ SwapFree:       897676 kB
-jailshell: SwapFree:: command not found
-jailshell-2.05b$

Posted

Dear George,

Thanks. (Starting to take a look for clues).

OBTW: MySQL has a "nice option" built into the command line now:

--nice=priority

Use the nice program to set the server's scheduling priority to the given value. This option was added in MySQL 4.0.14.

MySQL Reference

More later.

Cheers!

Yours sincerely,

Mr. Farang

Posted

Swap: 1077501952 158281728 919220224

Dear George,

If the scheduling priority of MySQL is not higher than the rest of the processes in the process table, it is possible during heavy loads (like backups) that MySQL processes could start to swap into that 158MB of swap space that is being used. If MySQL processes are swapping in-and-out, that is likely the source of the problem.

I would try making MySQL the highest possible scheduling priority and make the backup process the lowest possible scheduling priority, as the first thing to try - or simply add the -nice option to the MySQL command line per the mysqld man page (first, before lowering the priority of the backup command).

Yours sincerely,

Mr. Farang

Posted

Dear Khun George,

Another thing to check is to look at the process table using "ps" when having the MySQL connection problems and look at the STAT column of the process table output as well as the scheduling priority of all the processes.

Yours sincerely,

Mr. Farang

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...