LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-23-2014, 01:02 AM   #1
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Rep: Reputation: Disabled
Plesk throttling web traffic - Centos 6.4 - Plesk 11.5


Hey,

I'm running a custom application on a server with plesk 11.5. The client complains that the website stops loading while adding content to the system, this does not happen everyday though. The application is a news publishing system so data entry is pretty intensive. The problem is that this doesn't seem to effect everyone, examining external uptime reports does not show any evidence of the problem either.
This leads me to suspect that plesk is throttling connections to the IP from which our client is logging on, any idea how I can fix this problem?
 
Old 01-24-2014, 11:29 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Is the client doing anything additional when they're working? I've had clients complain about poor performance on web applications but they were streaming youtube and music while working. The streaming significantly slowed their load times so really the "slow application" was just them working while doing network intensive stuff and not the application at all.
 
Old 01-24-2014, 11:34 AM   #3
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Original Poster
Rep: Reputation: Disabled
I've inspected the log files and this is what I see, hundreds of such lines

Code:
mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: index.php
Below is my fcgid.conf

Code:
LoadModule fcgid_module modules/mod_fcgid.so

<IfModule mod_fcgid.c>

<IfModule !mod_fastcgi.c>
    AddHandler fcgid-script fcg fcgi fpl
</IfModule>

  FcgidIPCDir /var/run/mod_fcgid/sock
  FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

FcgidInitialEnv RAILS_ENV production
 
FcgidIdleTimeout 3600
FcgidIdleScanInterval 480
FcgidBusyTimeout 1800
FcgidBusyScanInterval 480
FcgidZombieScanInterval 12
FcgidErrorScanInterval 12
FcgidProcessLifeTime 0

# Change the rate at which new FastCGI processes are spawned under load. Higher=faster
FcgidSpawnScoreUpLimit 10
 
# Higher number = spawning more FastCGI processes decreases the spawn rate (controls runaway
FcgidSpawnScore 1
 
# Higher number = terminating FastCGI processes decreases the spawn rate (controls runaway)
FcgidTerminationScore 2
 
# Increase the FastCGI max request length for large file uploads (needed for some sites)
FcgidMaxRequestLen 1073741824
 
FcgidMaxRequestsPerProcess 100000
#FcgidMinProcessesPerClass 3
FcgidMaxProcessesPerClass 4
FcgidMaxProcesses 16
FcgidIOTimeout 1800
And my server specs

Code:
Processor: AMD Opteron 3280 Octacore
RAM: 24GB
HDD: 2x2TB Sata
OS: CentOS 6.4 64-bit
Plesk Vr: 11.5
Any idea how I could tune fcgid to avoid such errors? Well, given that fcgid is the one being exhausted.

Edit: I'm running Apache + PHP-FastCGI

Last edited by imadsani; 01-24-2014 at 11:35 AM.
 
Old 01-24-2014, 11:41 AM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Originally Posted by imadsani View Post
I've inspected the log files and this is what I see, hundreds of such lines

Code:
mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: index.php
*snip*

Any idea how I could tune fcgid to avoid such errors? Well, given that fcgid is the one being exhausted.
Some light google on your error message gives some results about how to tune the values. e.g.

http://stackoverflow.com/questions/1...y-process-slot
 
Old 01-24-2014, 11:51 AM   #5
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Original Poster
Rep: Reputation: Disabled
yeah, i looked at that this afternoon. But the thing is, the average load on the server never goes above an average of 4(8 cores) and cpu load averages at 30% throughout the day. The solution say's that either of these two will hit 100% and to then tune a couple of variables, but here i don't see anything touching 100% utilization.

Edit: This stuff is new to me, if i'm understanding this right, I need to increase FcgidMaxProcesses to above the current set value of 16? If so then how much should i it increment by?

Last edited by imadsani; 01-24-2014 at 11:54 AM.
 
Old 01-24-2014, 11:53 AM   #6
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
Originally Posted by imadsani View Post
yeah, i looked at that this afternoon. But the thing is, the average load on the server never goes above an average of 4(8 cores) and cpu load averages at 30% throughout the day. The solution say's that either of these two will hit 100% and to then tune a couple of variables, but here i don't see anything touching 100% utilization.
Based on what I've read it sounds like you're not CPU bound so you can increase the max number of workers. Since your max daily processing doesn't surpass 30% then I recommend tripling your current max value and see what happens.

Code:
FcgidMaxProcesses 48
Be mindful of machine memory when you're doing this. If you have a low amount of memory then you might be bound by memory for the number of allowed workers. Swapping memory will cause large performance issues. You can use apache benchmark to benchmark how many requests your server can handle (part of apache2-utils package).

Last edited by sag47; 01-24-2014 at 11:58 AM.
 
1 members found this post helpful.
Old 01-24-2014, 11:56 AM   #7
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Original Poster
Rep: Reputation: Disabled
^ thank's a lot, will try it out.
 
Old 01-29-2014, 08:50 AM   #8
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Original Poster
Rep: Reputation: Disabled
Hey,

I doubled the value again, this time to 96 but still getting. Secondly google analytics reports 170 people and the website is dead slow.

Code:
mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
Connection reset by peer: mod_fcgid: error reading data from FastCGI server
Premature end of script headers: index.php

Some screen grabs

http://i1196.photobucket.com/albums/...pse7bf2b01.png

http://i1196.photobucket.com/albums/...psbe19ffee.png

http://i1196.photobucket.com/albums/...ps347a94c8.png

http://i1196.photobucket.com/albums/...psdc2c675c.png

http://i1196.photobucket.com/albums/...psdd0dc1d5.png
 
Old 01-29-2014, 10:58 AM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
What are the specs of your host?

How much RAM, how many processing cores, how many threads in each core?
 
Old 01-29-2014, 02:35 PM   #10
imadsani
Member
 
Registered: Aug 2013
Distribution: CentOS 6.5
Posts: 64

Original Poster
Rep: Reputation: Disabled
This is a screen of htop

http://i1196.photobucket.com/albums/...ps03b3865e.png

load time seems to be back to normal, google analytics reports around a 100 people on the site right now.

Last edited by imadsani; 01-29-2014 at 02:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which user:group is best for CMS modules on CentOS/Plesk? svedish Linux - Newbie 10 02-26-2013 04:16 AM
[SOLVED] more than one uid 0 - centOS/Plesk 10.x micxz Linux - Security 28 08-04-2011 07:41 AM
more than one uid 0 - centOS/Plesk 10.x (OT) orgcandman Linux - Security 9 07-12-2011 03:42 PM
ls command fails after updating plesk on centos 5.4 delmoras Linux - General 3 06-02-2010 01:30 PM
Plesk 9/CentOS symlinks prophoto Linux - Server 1 02-19-2009 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration