Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Tutorial - Increase Magento’s perfomances without [edit] a lot of [/edit] core changes
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 
furnitureforyoultd - 09 June 2009 03:30 PM

Followed these instructions and noticed a slight difference:
1 Connection: 6 req/sec (previously only 1-2)
2+Connections: 12/req sec

Apache - 2.2.9
PHP - 5.2.6
MySQL - 5.0.45

CPU: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz
RAM: 1Gb
Redhat Linux Fedora 8

How can I increase the available memory shown in apc.php? and what can be done to apache to speed it up in regards to number of servers running etc?

Post a few more details if you wouldn’t mind.

What hard drive(s) do you have?
Are you running MySQL on the same system?
What MPM (if any) are you running for Apache?
Is the server in production and running other sites at the moment?
Where are you benchmarking from (home/same system/remote system on same network)?

You can’t really ‘speed up’ Apache, but you can try and help the way it performs, select an MPM, prefork for example. Then you can go about setting your child servers. Basically, you need to calculate how many concurrent connections you can handle.

Based on an average Apache child size of 25MB for a Magento page, you can calculate how many you can support by checking out free memory.

If your DB is on the same server, its best allocating at least 350-400MB to it. Deduct overheads from the OS itself (~200-300MB), which will leave you about 300-400MB free memory for Apache/PHP. Increase PHP’s max memory limit to 64MB, then we’ve got about 300MB left to play with. 300MB / 25MB = 12 concurrent connections—eek!

If the server is solely for Magento, then it would probably look something like this,

<IfModule mpm_prefork_module>
  
StartServers          5
  MinSpareServers       5
  MaxSpareServers      10
  MaxClients           20
  MaxRequestsPerChild    1500
</IfModule>

Your system really needs more memory. Check the ouput of

# top
# free -m

Look at ‘top’ and look for &#xWA; - this tells you the queue for disk writes, looking at ‘free’, look at the second row at the end, this will give true free memory.

There is a massive amount you can change and far too out of the scope of this post. I would suggest paying a professional to setup your server optimally, or simply throw more hardware at it.

And to follow up ...

Dillweed - 09 June 2009 04:02 PM

One ought to get use to it, because 99% of the post in this forum are answered by someone trying to sell something.  I see nothing wrong with it.

Very true, but I think the point was ‘keep it relevant’. However, @furnitureforyoultd if you want assistance configuring your sever I’m sure we could help, get in touch with us

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 
Sonassi Media | Hosting and Design - 09 June 2009 11:11 PM

Post a few more details if you wouldn’t mind.

What hard drive(s) do you have?
Are you running MySQL on the same system?
What MPM (if any) are you running for Apache?
Is the server in production and running other sites at the moment?
Where are you benchmarking from (home/same system/remote system on same network)?

You can’t really ‘speed up’ Apache, but you can try and help the way it performs, select an MPM, prefork for example. Then you can go about setting your child servers. Basically, you need to calculate how many concurrent connections you can handle.

Based on an average Apache child size of 25MB for a Magento page, you can calculate how many you can support by checking out free memory.

If your DB is on the same server, its best allocating at least 350-400MB to it. Deduct overheads from the OS itself (~200-300MB), which will leave you about 300-400MB free memory for Apache/PHP. Increase PHP’s max memory limit to 64MB, then we’ve got about 300MB left to play with. 300MB / 25MB = 12 concurrent connections—eek!

If the server is solely for Magento, then it would probably look something like this,

<IfModule mpm_prefork_module>
  
StartServers          5
  MinSpareServers       5
  MaxSpareServers      10
  MaxClients           20
  MaxRequestsPerChild    1500
</IfModule>

Your system really needs more memory. Check the ouput of

# top
# free -m

Look at ‘top’ and look for &#xWA; - this tells you the queue for disk writes, looking at ‘free’, look at the second row at the end, this will give true free memory.

There is a massive amount you can change and far too out of the scope of this post. I would suggest paying a professional to setup your server optimally, or simply throw more hardware at it.

And to follow up ...

Dillweed - 09 June 2009 04:02 PM

One ought to get use to it, because 99% of the post in this forum are answered by someone trying to sell something.  I see nothing wrong with it.

Very true, but I think the point was ‘keep it relevant’. However, @furnitureforyoultd if you want assistance configuring your sever I’m sure we could help, get in touch with us

MySQL is running on the same server - it handles the entire website. Server is on a production site with our site exclusively, and I was benchmarking from the same server. not sure the exact hard drive (host has updated their product specs to newer versions) but it’s only 71gb

these are the results of top & free -m

top 18:34:14 up 172 days18:02,  1 user,  load average0.400.210.12
Tasks
116 total,   2 running114 sleeping,   0 stopped,   0 zombie
Cpu
(s):  0.3&#xus;,  0.2&#xsy;,  0.0&#xni;, 99.5&#xid;,  0.0&#xwa;,  0.0&#xhi;,  0.0&#xsi;,  0.0&#xst;
Mem:    904528k total,   814088k used,    90440k free,    59972k buffers
Swap
:  2048276k total,    62448k used,  1985828k free,   295732k cached

  PID USER      PR  NI  VIRT  RES  SHR S 
&#xCP;U &#xME;M    TIME+  COMMAND
 
6497 apache    20   0 73736  28m  18m S    0  3.2   0:02.21 httpd
 6506 apache    20   0 73808  28m  18m S    0  3.3   0
:01.35 httpd
 7668 root      20   0  2272 1004  784 R    0  0.1   0
:00.07 top
30570 apache    20   0 84488  49m  28m S    0  5.6   0
:24.32 httpd

             total       used       free     shared    buffers     cached
Mem
:           883        795         88          0         58        288
-/+ buffers/cache:        447        435
Swap
:         2000         60       1939

definately needs more memory then, so I guess it’ll be upgrading to a newer package. thanks for the help

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 

When running your benchmarks, run

# top

And keep your eye on CPU load and the figure next to % WA - it tells you if the application is becoming IO bound.

RAM is only going to limit your capacity at present, not overall performance. Before upgrading, look at learning how to get the best from your server, there is a lot to learn about *nix *nux optimisation - we learn everyday.

 
Magento Community Magento Community
Magento Community
Magento Community
 
marknet
Member
 
Total Posts:  46
Joined:  2008-06-19
 

<DELETED> SImpleHelix has fixed the situation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kammalou
Sr. Member
 
Avatar
Total Posts:  285
Joined:  2009-01-20
Denmark
 

@ lodgerfootwear

Digged into it. Siege does indeed test in another way. Perfect! - And thanx for helping me to understand what the diffence is.

I’ve done some more optimizations and tried benchmarking our demo site : http://demo.magentopartner.com
With the same command you used (siege -c 100 -t 25S http://demo.magentopartner.com):

Lifting the server siege...      done.                                                                                     
Transactions:                    1129 hits
Availability
:                 100.00 %
Elapsed time:                  24.14 secs
Data transferred
:               5.04 MB
Response time
:                  1.53 secs
Transaction rate
:              46.77 trans/sec
Throughput
:                     0.21 MB/sec
Concurrency
:                   71.51
Successful transactions
:        1129
Failed transactions
:               0
Longest transaction
:            6.92
Shortest transaction
:           0.01

Maybee it’s possible for you to do your test again.

@Sonassi:

Oh yes, open_basedir IS a perfomance killer!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
rsskga
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-15
San Francisco
 

I’ve followed the directions for setting up tmpfs, but I don’t know how to test/detect whether it is working properly. Can anyone tell me how to do this? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kammalou
Sr. Member
 
Avatar
Total Posts:  285
Joined:  2009-01-20
Denmark
 
rsskga - 07 November 2009 01:29 PM

I’ve followed the directions for setting up tmpfs, but I don’t know how to test/detect whether it is working properly. Can anyone tell me how to do this? Thanks!

PM Me the website URL And i can benchmark it for you.

You might also want to consider the other options for optimizing performance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

just to bring this thread back to life..

on a dedicated server with 2 gig of ran and a core 2 duo at 2.5.. shouldn’t i be seeing better than this?

Concurrency Level:      20
Time taken 
for tests:   100.21641 seconds
Complete requests
:      519
Failed requests
:        7
   
(Connect0Length7Exceptions0)
Write errors:           0
Non
-2xx responses:      3
Total transferred
:      11537235 bytes
HTML transferred
:       11290717 bytes
Requests per second
:    5.19 [#/sec] (mean)
Time per request:       3854.399 [ms] (mean)
Time per request:       192.720 [ms] (meanacross all concurrent requests)
Transfer rate:          112.64 [Kbytes/sec] received
 
Magento Community Magento Community
Magento Community
Magento Community
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 

That would certainly depend on your setup wink Is the DB local or remote?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

local

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 

So assuming you’ve allocated about 768MB RAM to the DB, you’ll have 1256 left, put 256MB to OS overheads and other apps, it leaves around 1GB for Apache.

Given each Apache child consumes about 30MB RAM, the max clients you can handle at any given time (without swapping) is around 30 concurrent connections.

Have a look here, http://www.sonassi.com/knowledge-base/what-makes-us-the-fastest-magento-host-then/

I would imagine from a dual core, you could scrape about 18 RPS in an ideal world. If you are still struggling to improve performance, we offer consultation with guaranteed results (ie. you don’t pay if there isn’t a marked improvement).

Best of luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

ok - will keep that in mind..

the funny thing is that real world perceived performance is great.. way way faster than my previous vps.  the page loads are as isntant as a human could want.. its your blasted bench mark scheme that has got me feeling inferior wink

will have a play with your suggestions..

thanks for the info

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 

Lol! The trouble with benchmarking is that it can drive you on to achieving figures which look great on paper, but as you say - have little bearing on real world performance.

We don’t use siege or ab as a measure for any of our testing, we wrote a custom app for full page load testing - which we use on http://magebenchmark.sonassi.com.

If you get stuck and want some assistance feel free to email us - and if we’re in a good mood, maybe we’ll offer a little help for free wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
askeys
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2009-12-19
 

It is great to find the perfect tutorial for our requirements. I hope this kind of thing is essential for showing a lot of improvements in their work to move in a nice manner. The tutorial is very impressive to read it. I believe this kind of thing is very essential for anyone to deal with the proper amount of interest. Thanks for giving the proper information to others.
It really tempts me to read it once again in Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

err my httpd.conf does not have a <IfModule mpm_prefork_module>

only a <IfModule prefork_module>

is this the same or different?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top