LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-26-2010, 10:44 AM   #1
gcan
LQ Newbie
 
Registered: Apr 2009
Posts: 11

Rep: Reputation: 0
Apache slow, other services fast


Hello,

After server OS (Debian) reinstallation everything was OK and I opened my website to the visitors. After some time I noticed that Apache periodically becames very slow. I can 10-20 clicks and pages load immediately. Then for some 1-2 minutes I can hardly open some page. Then it works fast again. Sometimes 50% of the images on the page load very fast. Then loading freezes for some time, then continues loading again.

Other users report the same problem.

There are no spammers sending spam from this machine or something like that.

When this problem happends, everything runs fast on the server, except Apache. Server load is only ~0.2 - 0.3.

Apache configuration file has default settings and I was running this website with the same scripts and with th same Apache default settings for a long time. Never had problems.

Hostname lookups are disabled.

Any ideas?

PHP Code:
=============================

apache2.conf

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule mpm_prefork_module>
    
StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

<
IfModule mpm_worker_module>
    
StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

===================================

my.cnf

key_buffer              
16M
max_allowed_packet      
16M
thread_stack            
128K
thread_cache_size       
8
query_cache_limit       
1M
query_cache_size        
16M

=============================
cat meminfo

MemTotal
:      3629392 kB
MemFree
:       2907752 kB
Buffers
:         32120 kB
Cached
:         358672 kB
SwapCached
:          0 kB
Active
:         434180 kB
Inactive
:       242340 kB
HighTotal
:     2749072 kB
HighFree
:      2096336 kB
LowTotal
:       880320 kB
LowFree
:        811416 kB
SwapTotal
:     7815544 kB
SwapFree
:      7815544 kB
Dirty
:            3200 kB
Writeback
:           0 kB
AnonPages
:      285700 kB
Mapped
:          13596 kB
Slab
:            22544 kB
SReclaimable
:    12436 kB
SUnreclaim
:      10108 kB
PageTables
:       6608 kB
NFS_Unstable
:        0 kB
Bounce
:              0 kB
WritebackTmp
:        0 kB
CommitLimit
:   9630240 kB
Committed_AS
:   962492 kB
VmallocTotal
:   114680 kB
VmallocUsed
:      6236 kB
VmallocChunk
:   108004 kB
HugePages_Total
:     0
HugePages_Free
:      0
HugePages_Rsvd
:      0
HugePages_Surp
:      0
Hugepagesize
:     4096 kB 
 
Old 12-26-2010, 04:23 PM   #2
ilvista
Member
 
Registered: Nov 2010
Location: Ghazaouet
Distribution: Fedora OpenSuse
Posts: 153

Rep: Reputation: 27
I've had the same problem in the past.what i did ;i installed ATOP on my server to monitor my cpu and ram utilization.it's a nice tool.

in my case ,the mysqld was causing the problem.and it was overloding the CPU.
so try ATOP to eliminate this possibility.

good luck
 
Old 12-27-2010, 06:15 AM   #3
gcan
LQ Newbie
 
Registered: Apr 2009
Posts: 11

Original Poster
Rep: Reputation: 0
I changed Apache configuration file and the problem is gone. New settings:

PHP Code:
<IfModule prefork.c>
StartServers       15
MinSpareServers    10
MaxSpareServers   20
ServerLimit      512
MaxClients       512
MaxRequestsPerChild  0
</IfModule
It's very strange. For years I was using Apache's default settings and never experienced speed problems.
 
  


Reply



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
Apache server extreme slow, while samba server is extreme fast! Geert86 Linux - Server 5 01-17-2010 11:07 PM
Slackware was fast now is slow. C-Sniper Slackware 15 11-11-2007 10:23 PM
apache slow, only fast when i check "Use a proxy server.... sabre81 Linux - Networking 1 08-05-2005 07:41 AM
FC3 was fast, now VERY slow paseo1997 Fedora 2 02-03-2005 07:54 PM
internet fast-slow-fast-slow big_and_fat_guy Mandriva 5 10-11-2003 05:44 PM

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

All times are GMT -5. The time now is 11:53 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