LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 01-07-2012, 12:05 PM   #1
agriz
Member
 
Registered: Nov 2011
Posts: 174

Rep: Reputation: Disabled
httpd dead but pid file exists


Hi

Website suddenly didnt load.
When i check the httpd status, i got "httpd dead but pid file exists"

I restarted the httpd and it is working fine.
It seems site is not properly handling requests.

Can i get httpd.conf + my.cnf optimized setting?

Thanks
 
Old 01-07-2012, 09:10 PM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

'Optimized settings' would refer and be applicable to your system and use of Apache in combination with MySQL. Since we have no idea what and how you use your server it's pretty hard to advice. You could start with posting your current configuration files and tell as much as possible about the use of your website, what it is, what data it processes, the load you have on the server, database setup and use, ... The more in formation you can provide without revealing private information of course, the better we can try to help out.

Kind regards,

Eric
 
Old 01-07-2012, 09:25 PM   #3
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
It is centos 6
Site is using imagemagick based scripts.

I have enough free ram. But CPU reaches 100% load.

httpd-2.2.15-15.el6.centos.x86_64
mysql-5.1.52-1.el6_0.1.x86_64
mysql-libs-5.1.52-1.el6_0.1.x86_64
mysql-server-5.1.52-1.el6_0.1.x86_64

httpd.conf

Yesterday i changed the settings to the following from default values

Timeout 300
KeepAlive On
MaxKeepAliveRequests 0

StartServers 16
MinSpareServers 15
MaxSpareServers 64
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 100000

Let me know if you need more details.
It is i7 with 3.4 ghz process. But still the cpu usage reaches 100%
 
Old 01-07-2012, 09:28 PM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Can you shed some more light on the site and use of it? What does it do at database level? Which process(es) are putting your server to 100%? Output of top would be nice to start with.

Kind regards,

Eric
 
Old 01-07-2012, 09:43 PM   #5
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
top - 09:09:52 up 24 days, 11:31, 1 user, load average: 3.27, 2.29, 2.26
Tasks: 460 total, 2 running, 454 sleeping, 3 stopped, 1 zombie
Cpu(s): 46.0%us, 0.4%sy, 0.0%ni, 53.5%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 7972464k total, 5379240k used, 2593224k free, 85612k buffers
Swap: 10190840k total, 54148k used, 10136692k free, 731160k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2750 apache 20 0 590m 5136 2300 R 18.6 0.1 0:00.56 convert
12296 mysql 20 0 3197m 28m 4416 S 4.7 0.4 19:04.48 mysqld
24600 apache 20 0 289m 19m 7364 S 0.7 0.3 0:02.60 httpd
3949 apache 20 0 286m 16m 7128 S 0.3 0.2 0:01.78 httpd
7644 apache 20 0 286m 16m 7140 S 0.3 0.2 0:01.81 httpd
9351 apache 20 0 286m 16m 7240 S 0.3 0.2 0:02.41 httpd
9403 apache 20 0 286m 17m 7112 S 0.3 0.2 0:01.79 httpd
14244 apache 20 0 286m 16m 7232 S 0.3 0.2 0:01.59 httpd
16732 apache 20 0 286m 16m 7200 S 0.3 0.2 0:01.81 httpd
18518 prabha 20 0 97872 1928 872 S 0.3 0.0 0:03.38 sshd
23328 apache 20 0 286m 17m 7328 S 0.3 0.2 0:03.28 httpd
26744 apache 20 0 287m 17m 7276 S 0.3 0.2 0:02.13 httpd
30852 apache 20 0 286m 16m 7236 S 0.3 0.2 0:01.20 httpd
Home page loading is very slow, which is just a static page.
 
Old 01-07-2012, 09:53 PM   #6
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
Quote:
netstat -n | grep :80 |wc -l
1289
Quote:
netstat -n | grep :80 | grep SYN |wc -l
130

Could it be an attack?
Is there anyway to track and stop if it is attack?
 
Old 01-09-2012, 06:30 AM   #7
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
It seems because of the increased traffic, I am having such a problem.
I am using webmin which loads fast.

Site is just loading slowly.
How to fix it up?
 
Old 01-09-2012, 10:56 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,251

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Your top output shows that convert and mysql are using a lot of CPU, I would expect mysql to use a fair bit, so it's your "convert" that is taking up a fair bit.

I'm assuming that as you say the processor is an i7 that this is a desktop machine rather than a "server", your 1/5/15min loads are over 2, along with a Cpu(s): 46.0%us would suggest that your computer may be under-specified for the application you are running. Have you tried running sar to see your CPU load levels over time? and if so, are they similar.

Your MaxRequestsPerChild 100000 seems high, I usually set mine to around 2000 to cause the child processes to re-cycle quicker.

How many users / page displays are you doing with this server?
 
Old 01-09-2012, 10:59 AM   #9
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
Google analytics shows 400 active users.
Why webmin is faster and site is slower?

How do i use sar?
 
Old 01-09-2012, 11:06 AM   #10
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,251

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Quote:
Originally Posted by agriz View Post
Google analytics shows 400 active users.
Is that using Analytics Real-Time? If so, then your i7 is going to be vastly under-powered.
Quote:
Originally Posted by agriz View Post
Why webmin is faster and site is slower?
Webmin uses its own built in server rather than apache, as for why your site is slower, you haven't told us anything about your site other than it uses imagemagick scripts, so we don't know what it's doign or supposed to be doing.
Quote:
Originally Posted by agriz View Post
How do i use sar?
Type sar at the command prompt.
 
Old 01-09-2012, 11:20 AM   #11
agriz
Member
 
Registered: Nov 2011
Posts: 174

Original Poster
Rep: Reputation: Disabled
I found the problem. It is dos attack.

Quote:
possible SYN flooding on port 80. Sending cookies.
in messages.
I have installed csf and and enabled the following.
CT_LIMIT = 25 and SYNFLOOD = 1

What else should i do now to avoid it?
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd dead but subsys locked, but pid exists mlgunner Linux - Server 1 04-14-2011 01:55 PM
dead but pid file exists fahlen Linux - Software 1 12-18-2007 08:14 AM
[help] apache problem : httpd dead but pid file exists princenux Linux - Server 2 11-30-2006 05:26 AM
ntpd dead but pid file exists wjn Linux - Networking 15 05-22-2005 12:32 PM
nmbd dead but pid file exists Zaius Linux - Newbie 8 01-26-2004 02:45 PM


All times are GMT -5. The time now is 06:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration