Spree is running very slowly (typically 4 second page loads)

194 views
Skip to first unread message

Jay Rogers

unread,
Nov 16, 2009, 11:12:50 AM11/16/09
to Spree
I am new to Spree, but have been using Rails for about a year. I
really like what I've seen of Spree, and want to use it for an online
store. However, it is running very slowly on my development machine.
It generally takes 4 seconds or longer to load a page (for example,
when navigating from the home page to a product page). I've seen that
that the online demo runs quite fast enough, but on my machine it is
agonizingly slow.

Here is my development environment:

- Using localhost on a Windows XP system with 1GB RAM, and a 2.0 GHz
Duo Core processor.
- Ruby is latest 1.8.6-27_RC2 (i386-mswin32)
- Rails 2.3.4

Sean Schofield

unread,
Nov 16, 2009, 11:31:36 AM11/16/09
to spree...@googlegroups.com
The demo is running in production mode. Are you running locally in
production mode? The demo is also running the last gem version and
you're probably using edge.

There's a problem with a missing JS file which generates 404 on our
end. Firebug shows this takes a few seconds to try and locate this JS
and return the 404.

There is a ticket on this[1]. Maybe you can even provide a fix?
Otherwise I will look into it later but today is jammed full of client
stuff.


Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

[1] http://railsdog.lighthouseapp.com/projects/31096/tickets/895

Sean Schofield

unread,
Nov 16, 2009, 11:40:08 AM11/16/09
to spree...@googlegroups.com
By the way, the fix works fine. The reason it was still slow for me
was that I hadn't updated the relevant partial in my site extension.
I can't wait until theme support is done, it should make it easier to
just customize the piece you want (instead of entire view.)

Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

Jay Rogers

unread,
Nov 16, 2009, 9:47:57 PM11/16/09
to Spree
Sean,

Thanks for the quick reply. Following your advice, I found that if I
switched rails to production mode (using 'ruby script/server -e
production' to start the server) the app is very responsive. My
previous Rails have run adequately in development mode, so I did not
realize that production mode v. development mode would make that much
difference.

It's really working well now, and I'm looking forward to meeting with
my client tomorrow to show them my Spree prototype.

Thanks again for your help.

Jay

Sean Schofield

unread,
Nov 16, 2009, 10:33:14 PM11/16/09
to spree...@googlegroups.com
Just let us know when the site is done so everyone can see it ;-)

Sean Schofield

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------



jumph4x

unread,
Nov 16, 2009, 10:58:23 PM11/16/09
to Spree
For anyone reading, as well as for future reference this isn't a bad
thing to keep in mind and understand.

In development mode, the rails application is being reloaded for EVERY
request. Everything except routes and gems. Meaning the entire Spree
project, your extension(s) and any plugins as well as anything you've
put into the lib folders. That is an immense amount of stuff to work
with!

In production environment, the code is cached. This means that Spree
is loaded once and is kept in memory. Then once your extension adds
more models to it and class_eval's existing classes (and of course any
gems or plugins that add dynamic methods, unless it is
method_not_found automagic, do the same) the code sites in computer's
memory and is never altered until the production server is restarted
again.

You can see how reloading models, views and controllers is very
helpful while developing - it reflects changes immediately.

Hope this helps conceptualize how things work out.

Roman Smirnov

unread,
Nov 17, 2009, 4:10:23 AM11/17/09
to Spree
Btw, you can try to use Linux + Ruby EE[1] + thin server[2] for
development.
I always use this combination.
So, for Spree edge navigating from the home page to a product page
takes 600-800ms for me in development mode and 100-120 ms - in
production mode on localhost.

Roman Smirnov

-------------------------------------
[1] http://www.rubyenterpriseedition.com/index.html
[2] http://code.macournoyer.com/thin/

bai ubuntu

unread,
Nov 17, 2009, 4:27:12 AM11/17/09
to spree...@googlegroups.com
my server

centOS+spree(git)+rubyEE+passenger+nginx(lastest) +mysql

speed is faster

Saurabh Agarwal

unread,
Nov 17, 2009, 4:34:16 AM11/17/09
to spree...@googlegroups.com
Thanks for the detailed explanation.

I had deployed 2-3 rails apps on a hosting provider bluehost ( without
purchasing dedicated memory ) yes i know that will be slow and use
fastcgi but they are kind of prototypes so needed some real economy
package...

And the truth is none of them run in production env all of them
crashes however in development env all run fine .. my guess if because
it tries to take all the things in memory and may be server is denying
so much memory access leads to crash..


any other gusesses...

Thanks
Saurabh
--
http://reviewpunch.com/
Rate and review Products ,Services,Movies,Hotels,Restaurants,Mobile
phones,Electronic equipment,Startups

http://groups.google.com/group/ramprastha-gurgaon/
( Group for actual/prospective buyers of Ramprastha Gurgaon View/Atrium/Edge )

"Successful people make more mistakes because they do more "
Thanks
Saurabh Agarwal

Ing. Marcos Ortiz Valmaseda

unread,
Nov 17, 2009, 9:18:25 AM11/17/09
to spree...@googlegroups.com
I´m worried for one thing.
RubyEE is a commercial versión of Ruby for deployment?

Do you can share the completed configuration that you have on your server?
I want to become to use Nginx for production mode, but i want to use a good combination.
Regards



------------------------------------------------------------
"For me, the purpose is, at least partly, to have joy. Programmers often
feel joy when they can concentrate on the creative side of programming,
so Ruby is designed to make programmers happy."
Yukihiro Matsumoto (Matz), Creator of the Ruby Language

Ing. Marcos Luís Ortíz Valmaseda
PostgreSQL SysDBA && Rails Developer
BI and DWH Apprentice
Centro de Tecnologías de Almacenamiento y Análisis de Datos (CENTALAD)
Universidad de las Ciencias Informáticas (http://www.uci.cu)

Linux User # 418229

http://www.postgresql.org
http://www.postgresql-es.org
http://www.rubyonrails.org
http://www.ruby-lang.org/es/
http://www.planetrubyonrails.org/
http://www.planetpostgresql.org

Roman Smirnov

unread,
Nov 17, 2009, 12:10:42 PM11/17/09
to Spree
> centOS+spree(git)+rubyEE+passenger+nginx(lastest) +mysql
>
> speed is faster

Naturally, in this thread it is about work computer for development,
but not about the production server.
Reply all
Reply to author
Forward
0 new messages