It may not have anything to do with Apache - it could just be a
bandwidth issue. Try to run apache bench from your web server on
itself. For example, here''s the command to run apache bench to serve
up the /images/rails.png file from the webserver itself.
ab -c 1 -n 20 http://127.0.0.1/images/rails.png
That command requests the image 20 times, with 1 concurrent request.
You can adjust the numbers for whatever scenario you want to try out.
In the output, you can see how fast apache is serving up the file. I
just ran this and apache bench gave me:
Requests per second: 1766.00 [#/sec] (mean)
Now, try it from a remote box. For example, if I now run:
ab -c 1 -n 20 http://www.somethingnimble.com/images/rails.png
I get:
Requests per second: 23.33 [#/sec] (mean)
Apache bench will also give you the transfer rate. For my two test
runs, the results are:
Transfer rate: 3532.01 [Kbytes/sec] received
Transfer rate: 46.65 [Kbytes/sec] received
So clearly Apache is serving up the images quickly - it''s just
bandwidth that is slowing it down.
MPM worker is supposed to be better for multi-core servers, but if
you''re noticing sluggish page load times, I don''t think it
will be
your solution. A couple other things: are you using Rails asset
hosts? If you serve up your assets from different subdomains, the
browser will load more at once. Also, are you using the :cache option
of stylesheet_link_tag and javascript_include_tag to combine smaller
css and js files into 1 larger file? Are you using gzip to compress
your css and js files? Safari has a page load timeline view that
should give you good visibility into why your page load times are
slow.
-Dan Manges
http://www.dcmanges.com/blog
On Sep 21, 8:01 am, David
<passa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> We are running apache 2.2, mongrel and RoR 2.1.1. One of the issues
> we are seeing is the speed apache takes to load images out of the /
> public folder. The app flies and the response times from mysql and
> the queries is very fast. However, the time it takes for the initial
> load of an uncached page seems sluggish. any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---