Advertisement:

Author Topic: MySQL sleeping processes problem  (Read 21841 times)

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
MySQL sleeping processes problem
« on: September 16, 2012, 03:55:17 PM »
Hi everyone,

I'm having a problem with my forum on a VPS.
The CPU usage goes up to 100% at the moment (we had an event today and a lot of users are online).
I just called the hosting firm, and there were lot's of sleeping processes.

What should I do?

I'm running 2.0.2 with mods:
1.    SMF 2.0.2 Update    1.0    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
2.    Tapatalk SMF 2.0 RC4/RC5/Final Plugin    3.0.1    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
3.    Highslide 4 SMF    0.8.1    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
4.    SMF Trader System    1.6    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
5.    Aeva ~ Auto-Embed Video & Audio    7.1    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
6.    Stop Spammer    2.3.9    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
7.    Highslide 4 SMF    0.8    [ Overzicht bestanden ] [ Verwijderen ]
8.    httpBL    2.5.1    [ Installeer modificatie ] [ Overzicht bestanden ] [ Verwijderen ]
9.    Event Registration Mod for SMF2    2.19    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
10.    SimplePortal - Dutch    2.3.3    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
11.    SimplePortal    2.3.5    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
12.    SMF Arcade    2.5 RC1.1D    [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
13.    SimpleAds

Best regards

www.bimmerboard.be (BMW forum)

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #1 on: September 16, 2012, 05:00:12 PM »
are you using persistant connections ?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #2 on: September 17, 2012, 04:50:30 AM »
How can I check that?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #3 on: September 17, 2012, 05:03:44 AM »
in the database options of SMF, there is smthg like "use persistant connections", if checked, uncheck it.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #4 on: September 17, 2012, 05:05:27 AM »
Thanks, it was unchecked!

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #5 on: September 17, 2012, 05:06:26 AM »
At the moment the forum is fast again, but there not that many users online as last night. Now only 40 users online, yesterday >150.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #6 on: September 17, 2012, 05:07:56 AM »
I uploaded the status.php file:

perating System:    Linux 2.6.32-042stab053.5
Processor:    Intel® Xeon® CPU L5520 @ 2.27GHz (376.838MHz)
Load averages:    1.09, 0.71, 0.72
Current processes:    44 (42 sleeping, 1 running, 1 zombie)
Processes by CPU:    apache2 (14) 51.4%, mysqld (1) 3.8%, (other) (23) 0.0%
Memory usage:    19.356% (405928k / 2097152k)
Swap: 0% (0k / 0k)

Connections per second:    1.9618
Kilobytes received per second:    6.2666
Kilobytes sent per second:    75.6842
Queries per second:    33.2669
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    143.375 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0063 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0709 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    31.9674 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    0.875 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.036 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.3265 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.0656 (should be <= 0.05)

I will try to check this when the problem occurs again.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #7 on: September 17, 2012, 02:06:40 PM »
This is from a moment of weak performance/sluggish loading of site:

Operating System:    Linux 2.6.32-042stab053.5
Processor:    Intel® Xeon® CPU L5520 @ 2.27GHz (376.838MHz)
Load averages:    4.76, 6.15, 7.14
Current processes:    87 (67 sleeping, 20 running, 0 zombie)
Processes by CPU:    apache2 (57) 85.3%, mysqld (1) 4.8%, (other) (23) 0.0%
Memory usage:    73.715% (1545920k / 2097152k)
Swap: 0% (0k / 0k)
MySQL processes
Total processes:    23 (19 sleeping, 2 running, 2 locked)

Running processes
State    Time    Query
Sending data    1s    

SELECT
   a.id_attach, a.id_folder, a.id_msg, a.filename, a.file_hash, IFNULL(a.size, 0) AS filesize, a.downloads, a.approved,
   a.width, a.height,
   IFNULL(thumb.id_attach, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height
FROM smf_attachments AS a
   LEFT JOIN smf_attachments AS thumb ON (thumb.id_attach = a.id_thumb)
WHERE a.id_msg IN (955671, 955668, 955662, 955649, 955631, 955613, 955608, 955605, 955602, 955595, 955590, 955576, 955570, 955558, 955549, 955544, 955540, 955539, 955532, 955514, 955507, 955502, 955501, 955499, 955493, 955470, 955467, 955460, 955457, 955453)
   AND a.attachment_type = 0

MySQL Statistics
MySQL 5.0.x
Connections per second:    2.7549
Kilobytes received per second:    8.268
Kilobytes sent per second:    103.8621
Queries per second:    44.1575
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    254.3594 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0052 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0609 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    34.9453 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    1 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.0189 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.335 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.0496 (should be <= 0.05)

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #8 on: September 17, 2012, 03:41:40 PM »
perating System:    Linux 2.6.32-042stab053.5
Processor:    Intel® Xeon® CPU L5520 @ 2.27GHz (2261.033MHz)
Load averages:    3.13, 7.24, 7.03
Current processes:    136 (135 sleeping, 1 running, 0 zombie)
Processes by CPU:    apache2 (98) 157.9%, mysqld (1) 5.0%, (other) (23) 0.0%
Memory usage:    93.308% (1956804k / 2097152k)
Swap: 0% (0k / 0k)
MySQL processes
Total processes:    62 (60 sleeping, 2 running, 0 locked)

Running processes
State    Time    Query
Sending data    0s    

SELECT COUNT(*)
FROM smf_topics_posted_in AS pi
   LEFT JOIN smf_log_topics_posted_in AS lt ON (lt.id_topic = pi.id_topic)
WHERE pi.id_board IN (1, 56, 120, 6, 48, 75, 76, 79, 77, 80, 78, 8, 10, 84, 2, 111, 14, 9, 58, 130, 97, 90, 133, 134, 91, 100, 101, 106, 102, 132, 92, 103, 104, 105, 110, 93, 96, 94, 95, 107, 98, 99, 127, 138, 55, 26, 27, 43, 31, 109, 112, 131, 87, 50, 89, 114, 115, 119, 124, 125, 136, 137, 52, 135, 11, 45, 46, 72, 83, 24, 40, 29, 30, 126, 25, 122, 33, 121, 21, 5, 3, 37, 74, 12, 88, 44, 35)
   AND IFNULL(lt.id_msg, pi.id_msg) < pi.id_last_msg

MySQL Statistics
MySQL 5.0.x
Connections per second:    2.9012
Kilobytes received per second:    8.6631
Kilobytes sent per second:    109.4831
Queries per second:    46.3359
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    285.9375 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0046 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0599 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    31.902 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    0.625 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.0173 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.3362 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.0484 (should be <= 0.05)

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #9 on: September 17, 2012, 04:52:17 PM »
Apache load seems high, do you have APC enabled ?
What's the status of SMF cache ?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #10 on: September 17, 2012, 04:53:51 PM »
Apache load seems high, do you have APC enabled ?
What's the status of SMF cache ?
How to check?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #11 on: September 17, 2012, 05:49:55 PM »
In the admin section, server parameters, cache configuration, what does it say ? (Green or Red line)

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #12 on: September 18, 2012, 03:33:45 AM »
In the admin section, server parameters, cache configuration, what does it say ? (Green or Red line)
caching is off.
Should I put it on?

No danger for the board when putting it on?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #13 on: September 18, 2012, 03:48:56 AM »
Yes you should put it on, Level 1 is fine for most usage.
What does it says exactly ? is APC detected somehow ? If not you should activate it (or XCache), they are PHP opcode cache as well as being data caches, you should see a real boost in performance with APC in use.

When APC is not installed PHP must compile PHP files everytime, which is very ressource intensive, with APC the files are compiled once, placed in a cache and used from there whenever they are accessed.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #14 on: September 18, 2012, 04:01:46 AM »
OK I've put it on Level 1.

How can I see if APC is detected?
I just switched the dropdown box from "no caching" to "level 1 caching".
But there are nog green bars or whatever.

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #15 on: September 18, 2012, 04:55:35 AM »
Scroll down the text area above the cache level selection. There should either a green line if a software cache is detected or a red line if none is detected.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #16 on: September 18, 2012, 04:58:44 AM »
OK found it, thanks!

It's red  :(
SMF heeft geen compatibele accelerator op jouw server kunnen vinden.
or translated:
SMF did not found any compatibel accelerator on your server.

What to do?  ;D

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #17 on: September 18, 2012, 05:36:27 AM »
You have ssh access to the server ?
if so: sudo yum install php-pecl-apc

if not ask for the package to be installed and enabled on your vps.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #18 on: September 18, 2012, 05:45:25 AM »
You have ssh access to the server ?
if so: sudo yum install php-pecl-apc

if not ask for the package to be installed and enabled on your vps.
That command is unknown:

vps: sudo yum install php-pecl-apc
sudo: yum: command not found

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #19 on: September 18, 2012, 05:52:22 AM »
What distro is it ? I thought it was a RedHat one thanks to the kernel name but it looks like i was wrong or you are not authorized to install new packages  :(

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #20 on: September 18, 2012, 05:58:02 AM »
Linux 2.6.32-042stab053.5

Parallels Plesk Panel v10.4.4_build1013111102.18 os_Debian 5.0

This is all i know...

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #21 on: September 18, 2012, 06:09:13 AM »
ok try:
sudo apt-get update
sudo apt-get install php-apc (if it does not work try php5-apc instead of php-apc)

if the line above does not work no need to use the next one.
sudo /etc/init.d/apache2 restart


Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #22 on: September 18, 2012, 06:38:10 AM »
It didn't work. But i Phoned to the support desk and they are going to install it on the server.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #23 on: September 18, 2012, 07:44:41 AM »
OK it's installed now, and the text was green (apc detected) so now I've set at level 1.

Thank you for the help so far! I hope the problem will be solved now.

Current status:
asic Information
September 18, 2012, 01:43:41 PM
Operating System:    Linux 2.6.32-042stab053.5
Processor:    Intel® Xeon® CPU L5520 @ 2.27GHz (2261.033MHz)
Load averages:    0.48, 0.39, 0.44
Current processes:    66 (64 sleeping, 1 running, 1 zombie)
Processes by CPU:    apache2 (33) 62.9%, mysqld (1) 4.2%, (other) (25) 0.0%
Memory usage:    42.47% (890660k / 2097152k)
Swap: 0% (0k / 0k)
MySQL Statistics
MySQL 5.0.x
Connections per second:    1.8565
Kilobytes received per second:    6.3491
Kilobytes sent per second:    64.6863
Queries per second:    32.1854
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    125.7969 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0036 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0644 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    61.5287 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    0.875 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.0607 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.3344 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.1259 (should be <= 0.05)


I'm curious what the result will be tonight, when there are lot's of visitors/members.

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #24 on: September 18, 2012, 08:32:53 AM »
You should see a lot less apache clogging with APC enabled.
Let me know if you still encounter any issue.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #25 on: September 18, 2012, 01:36:29 PM »
OK now my forum it crowded.

The speed is still ok!


The only thing that still worries me is the fact that the RAM usage is still around 90% .
(VPS with 2 gig RAM)

Amount of visitors atm:
44 guests, 80 members

Is this amount of ram usage normal?

Stats:
Operating System:    Linux 2.6.32-042stab053.5
Processor:    Intel® Xeon® CPU L5520 @ 2.27GHz (376.838MHz)
Load averages:    0.61, 0.56, 0.81
Current processes:    74 (69 sleeping, 4 running, 1 zombie)
Processes by CPU:    apache2 (45) 60.8%, mysqld (1) 4.6%, (other) (22) 0.0%
Memory usage:    89.139% (1869388k / 2097152k)
Swap: 0% (0k / 0k)
MySQL processes
Total processes:    4 (3 sleeping, 1 running, 0 locked)
MySQL Statistics
MySQL 5.0.x
Connections per second:    2.3273
Kilobytes received per second:    7.1791
Kilobytes sent per second:    71.6654
Queries per second:    35.5276
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    187.1875 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0042 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0572 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    74.2663 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    0.625 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.0524 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.3703 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.0806 (should be <= 0.05)



Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #26 on: September 18, 2012, 02:20:24 PM »
could you type the following in an ssh shell:
Code: [Select]
free
and paste the results here.


Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #27 on: September 18, 2012, 02:59:20 PM »
could you type the following in an ssh shell:
Code: [Select]
free
and paste the results here.
How to do this? Start the SSH connection and type free in the console?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #28 on: September 18, 2012, 03:01:20 PM »
yes that's it. ;)

you should get smthg like this
Code: [Select]
             total       used       free     shared    buffers     cached
Mem:      16456712   15376420    1080292          0      46124   11168792
-/+ buffers/cache:    4161504   12295208
Swap:      1044220          0    1044220

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #29 on: September 19, 2012, 08:54:36 AM »
ok the current status (not so crowded):

Total
mem: 2097152 , used: 1568064, free: 529088, shared: 0, buffers: 0, cached: 1346940

-/+buffers/cashe: 221124  1876028

swap: 0 0 0

The speed is excellent

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #30 on: September 19, 2012, 09:12:22 AM »
About 1.8GB of your memory is used for caching and buffers, this is free memory being used for system optimization, but could be recovered for software use if a process need more memory. In fact you use just 220MB, so you are fine, no memory issue at all.  ;)

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #31 on: September 19, 2012, 09:13:47 AM »
About 1.8GB of your memory is used for caching and buffers, this is free memory being used for system optimization, but could be recovered for software use if a process need more memory. In fact you use just 220MB, so you are fine, no memory issue at all.  ;)
Great!

Thank you so much for your help. I owe you one!

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #32 on: December 18, 2012, 03:41:40 AM »
I have problems again.

Again with the sleaping processes.
After a mysql restart the server goes very smooth, but after a while on certain moments the server gets realy slow.
Any ideas how to solve this?

According to the hosting I have a LOT of sleaping Myscl processes.

Offline CoreISP

  • Server Admin
  • Server Team
  • SMF Super Hero
  • *
  • Posts: 18,002
  • Gender: Male
  • Liroy van Hoewijk
    • coreisp on GitHub
    • liroyvh on LinkedIn
    • @liroyvh on Twitter
Re: MySQL sleeping processes problem
« Reply #33 on: December 18, 2012, 10:12:27 AM »
Sounds like you have persistent connections enabled?
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #34 on: December 19, 2012, 07:21:57 AM »
Sounds like you have persistent connections enabled?

See second post in topic, persistent connections is off.

Offline CoreISP

  • Server Admin
  • Server Team
  • SMF Super Hero
  • *
  • Posts: 18,002
  • Gender: Male
  • Liroy van Hoewijk
    • coreisp on GitHub
    • liroyvh on LinkedIn
    • @liroyvh on Twitter
Re: MySQL sleeping processes problem
« Reply #35 on: December 19, 2012, 08:01:08 AM »
Mhm, then it sounds like you will have to start looking at the modifications. I'd begin with anything ajax, if any.

Define "a lot" of sleeping processes though?
Have you looked in to it yourself?
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

Offline Storman™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,027
Re: MySQL sleeping processes problem
« Reply #36 on: December 19, 2012, 01:00:15 PM »
Which of those mods do you actually have installed as I don't see many on your forum. Or if they are there then you're only using them "lightly".

Also, with the levels of activity you've described your forum should rock on the spec you've listed. I have about 8 forums running like that on a similar system and they are all pretty busy without any lag. Have you got anything else running in Plesk, like Spamassassin, or something else like that ?
Any Backup method is bettter than no Backup method....

Offline aman@odigma.com

  • Newbie
  • *
  • Posts: 7
Re: MySQL sleeping processes problem
« Reply #37 on: December 28, 2012, 01:39:52 AM »
thanks

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #38 on: January 02, 2013, 01:26:30 PM »

Modificatienaam   Versie   
1.   Tapatalk SMF 2.0 RC5/Final Plugin   3.3.0   [ Deïnstalleer ]
2.   SMF Arcade   2.5 RC1.1D   [ Deïnstalleer ]
3.   SMF Trader System   1.6   [ Deïnstalleer ]
4.   SimplePortal   2.3.5   [ Deïnstalleer ]
5.   SMF 2.0.2 Update   1.0   [ Deïnstalleer ]
6.   Highslide 4 SMF   0.8.1   [ Deïnstalleer ]
7.   Event Registration Mod for SMF2   2.19   [ Deïnstalleer ]
8.   Stop Spammer   2.3.9   [ Deïnstalleer ]
9.   SimpleAds   1.0.1   [ Deïnstalleer ]
10.   Aeva ~ Auto-Embed Video & Audio   7.1

(simple portal is not used)

Which one is likely to cause issues?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #39 on: January 02, 2013, 02:17:51 PM »
No spam assisin running.


http://www.simplemachines.org/community/index.php?topic=50217.0 --> could it be that i should change some stuff to innoDB? How to check?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #40 on: January 03, 2013, 03:17:16 PM »
It's is running slow again atm:

Operating System:   Linux 2.6.32-042stab053.5
Processor:   Intel® Xeon® CPU L5520 @ 2.27GHz (376.838MHz)
Load averages:   9.81, 4.00, 3.55
Current processes:   95 (86 sleeping, 8 running, 1 zombie)
Processes by CPU:   apache2 (66) 77.6%, mysqld (1) 4.7%, (other) (21) 0.0%
Memory usage:    87.573% (1836532k / 2097152k)
Swap: 0% (0k / 0k)
MySQL processes
Total processes:   25 (24 sleeping, 1 running, 0 locked)
MySQL Statistics
MySQL 5.0.x
Connections per second:    2.6235
Kilobytes received per second:    7.8861
Kilobytes sent per second:    39.5593
Queries per second:    35.3815
Percentage of slow queries:    0
Opened vs. Open tables:
(table_cache)    1336.4844 (should be <= 80)
Table cache usage:
(table_cache)    1 (should be >= 0.5 and <= 0.9)
Key buffer read hit rate:
(key_buffer_size)    0.0044 (should be <= 0.01)
Key buffer write hit rate:
(key_buffer_size)    0.0919 (should be <= 0.5)
Thread cache hit rate:
(thread_cache_size)    76.2202 (should be >= 30 )
Thread cache usage:
(thread_cache_size)    0.375 (should be >= 0.7 and <= 0.9)
Temporary table disk usage:
(tmp_table_size)    0.0199 (should be <= 0.5)
Sort merge pass rate:
(sort_buffer)    0 (should be <= 0.001)
Query cache enabled:
(query_cache_type)    1 (should be >= 1 and <= 1)
Query cache miss rate:
(query_cache_limit)    0.428 (should be <= 0.5)
Query cache prune rate:
(query_cache_size)    0.0746 (should be <= 0.05)



Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #41 on: January 03, 2013, 05:13:36 PM »
I uninstalled highslide4smf. Problem seems solved.
Server is realy fast now...

Now i'll let it test run for 2 days. Afterwards I will install APimage.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #42 on: January 04, 2013, 04:13:47 AM »
It's clear that HS4SMF was the cause.

Anyone has a good alternative for that?

APimage doesn't seem to work with me.

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #43 on: January 04, 2013, 08:08:42 AM »
hummm AFAIR the default install of hs4smf uses preloading.

Set hs.cacheAjax to false (in the h4smf.php) in case you rely on hs4smf for loading webpages, else it will load the pages even before they are opened causing a vast amount of traffic server side.

Moreover in index.php search for
Code: [Select]
// Attachments don't require the entire theme to be loaded.
comment 
Code: [Select]
&& (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])so that the code looks like this:

Code: [Select]
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach')/* && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])*/
detectBrowser();
else
loadTheme();
(It will deactivate theme loading for attachments)

and then test again with hs4smf.

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #44 on: January 05, 2013, 11:03:53 AM »
I can't seem to find the HS4SMF.php, in what folder should i find that?
I did find hs4sm-subs.php but that does not contain hs.cacheAjax.

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #45 on: January 05, 2013, 01:36:42 PM »
I can't seem to find the HS4SMF.php, in what folder should i find that?
I did find hs4sm-subs.php but that does not contain hs.cacheAjax.
I can't seem to find the HS4SMF.php, in what folder should i find that?
I did find hs4sm-subs.php but that does not contain hs.cacheAjax.
that's the one !
in hs4smf_prepare_footer add:
$footer .= 'hs.cacheAjax = false;' ."\n";
before    
// Caption text Mode

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #46 on: January 06, 2013, 05:23:21 AM »

Moreover in index.php search for
Code: [Select]
// Attachments don't require the entire theme to be loaded.
comment 
Code: [Select]
&& (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])so that the code looks like this:

Code: [Select]
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach')/* && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])*/
detectBrowser();
else
loadTheme();
(It will deactivate theme loading for attachments)

and then test again with hs4smf.

I tried to do this but than I got:
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/bimmerboard.be/httpdocs/forum/index.php on line 216

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #47 on: January 06, 2013, 06:34:21 AM »
copy/paste your code here, you probably misplaced the /* */ or forgot an ;

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #48 on: January 06, 2013, 08:02:23 AM »
OK I forgot to put the ) to close the IF.

But there is still a problem, now Highslide isn't functioning  ;)
What to do?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: MySQL sleeping processes problem
« Reply #49 on: January 06, 2013, 04:20:10 PM »
any error in the javascript console ?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #50 on: January 10, 2013, 04:43:03 PM »
These are the errors I see every member has

84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=38348.30;topicseen   Vandaag om 22:36:10
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.msg1012073   Vandaag om 22:30:05
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.240;topicseen   Vandaag om 22:25:15
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=37293.0;topicseen   Vandaag om 22:19:38
84.194.92.149   8: Undefined index: tp_pushEnabled
?action=pm;sa=send2   Vandaag om 22:19:30
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=13799.5100;topicseen   Vandaag om 22:18:01
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.new   Vandaag om 22:17:52
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.msg1012045   Vandaag om 22:17:46
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=38171.0;topicseen   Vandaag om 22:04:03
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.new   Vandaag om 22:03:32
84.194.92.149   8: Undefined index: hs4smf_img_count
?topic=33465.240

etc.

Any idea?

Offline jan.van.gent

  • Semi-Newbie
  • *
  • Posts: 70
Re: MySQL sleeping processes problem
« Reply #51 on: January 16, 2013, 02:29:10 PM »
I still have problems.
Server CPU is 100% at evenings, while RAM usage is low.
Any ideas?

Could it be caused by those hs4smf errors? Something else?
Please?