Solved

Magento & Apache optimization

Posted on 2010-11-19
3
1,715 Views
Last Modified: 2012-05-10
Hi all,

I've a a linux Centos box with 8G B RAM & 1CPU  X3220 2.40GHz. Of these 8GB, 7GB is for the system and applications, and 1GB for the TMPFS.

It can be seen that the system is swapping. What should I do to prevent this?. Furthermore, I see apache it's consuming lots of memory, What should I do to prevent this?.

Top:
top - 02:55:32 up 4 days, 12:12,  2 users,  load average: 0.13, 0.24, 0.36
Tasks: 118 total,   1 running, 117 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.9%us,  0.1%sy,  0.0%ni, 98.8%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8177616k total,  7063824k used,  1113792k free,   255480k buffers
Swap:  6289320k total,    44728k used,  6244592k free,  5614920k cached

httpd.conf:

Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 2

# prefork MPM
<IfModule prefork.c>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      20
    ServerLimit         450
    MaxClients          450
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
<IfModule worker.c>
    StartServers          2
    MaxClients           250
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    ServerLimit          25
    MaxRequestsPerChild  25
</IfModule>

 Apache/2.2.3
  Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

What directive has more weight in terms of memory?

Thanks in advance
0
Comment
Question by:VMWARE
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
Gabriel Orozco earned 500 total points
ID: 34182015
What I see is you have a lot of memory free:
Mem:   8177616k total,  7063824k used,  1113792k free,   255480k buffers
Swap:  6289320k total,    44728k used,  6244592k free,  5614920k cached

This is
1,113,792k free
   255,480k buffers
5,614,920k cached
----------------------------
6,984,192k free

Since you have 7,063,824k used this means you have lots of memory still there to be used.

You see apache using lots of memory? I would only believe that in the case you where using a java app or some other kind of server side app.

To see which processess are using swap, you can open the top program, the type the capital 'O' and after that the letter 'p'.

You will see now processes ordered by their swap usage. start minvestigating from there.
0
 
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 34182018
0
 

Author Comment

by:VMWARE
ID: 34186829
Hello Redimido,

I'm using PHP.

The output of top processes ordered by their swap usage

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND
 2618 mysql     15   0 1074m 288m 6836 S 74.2  3.6   5140:27 786m mysqld
 6005 apache    15   0  373m 8816 1480 S  0.0  0.1   0:00.00 365m httpd
 5995 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5996 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5997 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5999 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 6004 apache    15   0  373m 8828 1488 S  0.0  0.1   0:00.00 365m httpd
 6007 apache    15   0  373m 8832 1492 S  0.0  0.1   0:00.00 365m httpd
.
.
.
If I have so much free memory, why it's swapping?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
installing docker on ubuntu 6 36
awk file 6 77
Samba Question 11 71
parallel rsync issues with Ubuntu 1 21
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Fine Tune your automatic Updates for Ubuntu / Debian
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

790 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