Linux / Apache Server Stats. Is everything fine with the Server?

We have recently migrated to LAMP Dedicated Server. Our application is a Online Travel Booking Engine made up of PHP, Javascript, XML, and MySQL. I am new to Linux Server and i have doubts that the Server dosnt scale well. Many a times when i open my site to test the response is very slow. I am looking for some information about:

1. How do i know how the Server is Performing under various load conditions.
2. How do i know my server can handle how many simultaneous users at a time.
3. Is the RAM sufficient? Curently i have 2 GB of RAM.
4. What i can do to make the server more Scalable.

Below are some figures i have got from the WHM.

Memory Information
Memory: 2073168k/2096896k available (1945k kernel code, 22768k reserved, 787k data, 204k init, 1179392k highmem)

Current Memory Usage
             total       used       free     shared    buffers     cached
Mem:       2074616    2017076      57540          0     103128    1628992
-/+ buffers/cache:     284956    1789660
Swap:      2096472       6492    2089980
Total:     4171088    2023568    2147520

Current Disk Usage
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             182G  9.5G  163G   6% /
/dev/sda1              99M   24M   70M  26% /boot
none                 1013M     0 1013M   0% /dev/shm
/usr/tmpDSK           485M   11M  449M   3% /tmp
/tmp                  485M   11M  449M   3% /var/tmp

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Use ab to do a stress test on your site

 ab -kc 10 -t 30 http://localhost/

show the results

also do a top sorted with memory and ps aux

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
something like jmeter would be good for testing it under different loads
10 users, 20 user, 30 users upwards etc.

One thing that would be causing an issue here is the memory.
You have 2 GB but it is almost all used.

The first thing to drop is this :
none                 1013M     0 1013M   0% /dev/shm

This is a ram disk for passing data between your programs.  You have allocated it 1GB of your memory and you are not using it.

edit /etc/fstab and comment out the line with tmpfs or /dev/shm in it
then reboot and test again.

NabilbahrAuthor Commented:
Thanks, edster9999 and nabeelmoidu.
Is it normal that Server is using all RAM available. We are not having too much traffic on site. Is it strange that Server is using 2GB whole.
edit /etc/fstab and comment out the line with tmpfs or /dev/shm in it
then reboot and test again.

For this do i have to contact my host or i can do it myself on WHM?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

you need to drop to command line and edit a file.
If you have a dedicated server they should have given you ssh access.
use that log in as root and edit /etc/fstab
NabilbahrAuthor Commented:
Yes i have SSH access. After editing /etc/fstab, do i have to restart httpd or linux server?
no need to boot just type
umount /dev/shm

Yes, it's normal for the server to use all available RAM.  The amount of RAM being used under the "cached" column can be reclaimed at any time, and enhances performance of the server.

1. top, sysstat (sar), iostat, etc.
2. Load testing using benchmarking tools.  Which you use, depends on the target application, and who is writing the tests.  Once it starts being important enough to justify the cost, get a contractor to setup a benchmark suite for you.
3. Depends on how many users.  But RAM is cheap, and 2GB isn't much.  Install another 2GB for good measure, and plan on scaling to 16GB in the future.
4. Tune MySQL to use more memory.  There's some excellent tuning guides at MySQL.  This is the single biggest improvement you'll see.  You may also want to tweak the Min/Max spare servers settings, to better fit your load patterns.  But tweaking MySQL _will_ yield big improvements, probably what you're seeing the bottleneck on.

For MySQL, seriously consider switching from MyISAM to InnoDB.  You will take a big performance hit for this, but you'll gain a ton of reliability; can you afford to lose data?  Similarly, look into RAID 5 or RAID 10.  (Minimum 3 disks.)

For the MySQL engine, turn on query caching, set at least a 64mb buffer for it, and do the same for the key buffer.  From there, start reading the mysql tuning guides, and learn to read the stats, to make sure you're not adding too much memory.  Similarly, don't just increase the default buffers for queries; you may see short-term improvement, but sink the scalability.

Complex subject, and the amount of money on the line really dictates whether you should be asking here, or hiring someone to set things up for you.  If you're just trying to get a site off the ground, and traffic is still low, start with the global MySQL buffers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.