Solved

Linux / Apache / PHP Scalability Issues

Posted on 2009-05-19
2
648 Views
Last Modified: 2013-12-16
Hi,

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

 
0
Comment
Question by:Nabilbahr
2 Comments
 

Author Comment

by:Nabilbahr
ID: 24428133
I am inclding snapshot of XCache Admin Page and Server Disk Usage
xcache.jpg
server.jpg
apache.jpg
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24443240
Hi,

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
</IfModule>

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.

Cheers,
K.


0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now