Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Linux / Apache / PHP Scalability Issues

Posted on 2009-05-19
Medium Priority
Last Modified: 2013-12-16

We are having speed and scalability issues with our website hosted in LAMP environment. As i am new to Linux / Apache i am copying server related data here. Please let me know what i can do to imrove the scalability and speed of PHP scripts:

Current Memory Usage
                total           used           free         shared    buffers     cached
Mem:       3369064    3155716     213348          0     239616    2358752
-/+ buffers/cache:     557348    2811716
Swap:      4192956         68    4192888
Total:     7562020    3155784    4406236

Current Disk Usage
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             222G   15G  196G   7% /
/dev/sda1             251M   21M  217M   9% /boot
tmpfs                 1.7G     0  1.7G   0% /dev/shm
/usr/tmpDSK           485M  460M     0 100% /tmp

Following is statstics from XCache
Caches: - Slots Size Avail % Clear Compiling Hits Misses Clogs OOMs Protected Cached Deleted GC
php#0 8.00 K 64.00 M 36.81 M        no 83,690 985 10 0 no 976 0  
php#1 8.00 K 64.00 M 38.20 M        no 111,389 1,005 10 0 no 999 0  
var#0 8.00 K 8.00 M 7.97 M        - 0 0 0 0 no 0 0 29

Question by:Nabilbahr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 24428133
I am inclding snapshot of XCache Admin Page and Server Disk Usage
LVL 30

Accepted Solution

Kerem ERSOY earned 2000 total points
ID: 24443240

From what you've posted here I can not see any problem. It seems that your memory is OK. IT is normal that buffers take up so much space and levave very little free memory. But then again they are usable.

Data from your caches are also OK they say that you get 112556 hits but 1046 misses and 1040 of thm placed in the cache while your cache still runs at 60%.

Also your SWAP is empty if it was full it would indicate that you had semoe memory issues but my view on memory is also supprted by this also.

When it comes to your Web Statistics. IT indicates taht more than 18 hours of runtime and CPU is sitting idle 91 % with all the activity happens in apache (60 %) with 1,5 % System activity.

It also shows that there are 40 instances with stiell one request needs andother instance so that there's a new creation request.

I'll suggest you to install the package called systat. anc check sar and iostat activity. I wonder how much oh the 60% activity is consumed by HTTP and how much of it requesting file I/O. When you launch iostat the first row will give you the cumulated average actvity like sar.

In fact I guess that you must have your bottlenecks on server instances. You might like to reduce the numbers in your apache configuration. The initial server instances and minimum available sparse servers.

<IfModule prefork.c>
StartServers            100
MinSpareServers    40
MaxSpareServers   80
ServerLimit      1024
MaxClients       2048
MaxRequestsPerChild  4000

Also your keepalive settings. It seems that al your instances are at the keepalive. (waiting for additional requests for each instance) Shorten them:

MaxKeepAliveRequests 20
KeepAliveTimeout 15

After you've installed the systat package check iostat also and if you feel there's a bottleneck in I/O then install additional hard disks with disk striping so that it would speed up the I/O.

yum install sysstat

iostat 5 5

sar -q 5 5

Please note the runq-sz column in sar it should be aorund 0 - 2 in an mildly loaded system but greater on busy systems.



Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question