performance - Why is my sinatra website so slow? -


After asking

I started using Sinatra to serve web pages.

This evening, a friend, mine and I have started testing the speed of the server.

The logging file looks like this:

  'rubygems' is required 'sinatra' is required to enable 'haml': session #cookies for! Index End  

Get and index. It seems like:

 % title first page% title% h2 first page  

She's just sitting on a laptop, as I am, With an Apple 802.11N router between us. We are both running Windows 7. I have tried these files on laptops to run Ubuntu 9.10 x64 and all relevant files with Sinatra.

It takes 7 seconds to serve Sinatra, a single page request, no problem, server OS, Windows or Linux I think the author managed to get more than 400 requests / processed what gives? (Or should it be on a superuser or such?)

I will not have any opinion on that When you should customize your web application.

Set up different configurations in your Sinatra app for development and production, because some of these suggestions, you do not always want to use. In fact, you should probably proceed and be similar to setup and environment. As you will deploy in production. You will not simply deploy the Ruby app.rb . You want to keep Apache or NGNeaks in front of your Mongalil. Morgele will complete your static files, but it is actually just reasonable for the development mode. In deployment, a web server is going to work a lot better for that. In essence, your deployed environment will be faster than your healthy growth environment.

At this time, I do not care about monogram vs. thin. If the slender doubly is double - it's not - then your 7 seconds is 3.5. Would that be good enough?

To try some things ...

I know that I told you to set up a deployment environment, but maybe it is not server-side, do you run Or have tried on your pages? I / O is more likely to take those 7 seconds (DISCLAIMER: I'm assuming that there is nothing wrong with the establishment of your network from the server) YSlow - actually the firebug - will tell you that every part of your page comes into the browser How much time it takes for

YSlow had told me to say that one thing is a lot ahead of my static property, which I knew but was finally leaving optimism. It happened when I came to know that at least I myself have understood that it is the right place to do it in NGN.

If you are happy with those results, you can see the server. Out of the upper part of my head, is not so complete

  1. Turn on gzip responses.
  2. Combine your stylesheets, so only one per page request is one, some rack middleware may be for this, if you do not do it manually.
  3. I'm trying to cash.
  4. Use the prel to decrease the number of image downloads you use.
  5. Minimize your javascript. Then, maybe through the Rack Middleware.

The rack middleware is clean, but it uses CPU, so manually reducing your javascript adds a new step in your workflow, but on the server, it is faster than the middleware. This is a tradeoff.

Sorry it was griefing.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -