NetAdminTools.com
 
SignalQ Sites:
L1G3R Information Systems - Coprolite - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - FixRambler
Solar Energy - Energy Efficiency - Solar Panels
Home Energy Savings
Categories:
GNU/Linux | Homebrew designs | Perl | Ruby | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | ERP | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Ruby
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·ERP
·REALbasic
·All Categories


Moving from WEBrick to Mongrel
Topic:Ruby   Date: 2010-07-20
Printer Friendly: Print   

spacerspacer
<<  <   >  >>

Subject

I've been moving more and more pages over to NetAdminTools, and the render time is starting to take a long time.

=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-07-20 06:29:17] INFO  WEBrick 1.3.1
[2010-07-20 06:29:17] INFO  ruby 1.8.7 (2009-12-24) [i686-linux]
[2010-07-20 06:29:17] INFO  WEBrick::HTTPServer#start: pid=20168 port=3000
^C[2010-07-20 06:29:23] INFO  going to shutdown ...
[2010-07-20 06:29:23] INFO  WEBrick::HTTPServer#start done.
Exiting

Getting my RoR install to switch from WEBrick to Mongel was as easy as a couple of gem install commands:

root:/opt/mcjr/config# gem install mongrel
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed gem_plugin-0.2.3
Successfully installed daemons-1.1.0
Successfully installed fastthread-1.0.7
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed mongrel-1.1.5
5 gems installed
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for daemons-1.1.0...
Installing ri documentation for fastthread-1.0.7...

No definition for dummy_dump


Start up Mongrel:

root:/opt/mcjr# ./startitr
=> Booting Mongrel
=> Rails 2.3.4 application starting on http://0.0.0.0:5867
root:/opt/mcjr#

Install mongrel cluster:

root:/opt/mcjr/script# gem install mongrel_cluster
Successfully installed mongrel_cluster-1.0.5
1 gem installed
Installing ri documentation for mongrel_cluster-1.0.5...
Installing RDoc documentation for mongrel_cluster-1.0.5...
root:/opt/mcjr/script# 

I have struggled a lot in the past to get mongrel_cluster to start at boot. I had to put mongrel_rails in my path (I cheated and made a symbolic link) and I added this init script:

/usr/local/bin/mongrel_rails cluster::start -C /opt/mcjr/config/mongrel_cluster.yml

What I'm doing to render the pages is I pull the article numbers and create shell scripts that contain wget commands that I throw into the background. I then execute them five hundred at a time with 2 worker processes for Nginx and 40 RoR application servers (Mongrel). One trick I used was that after I'd spun off 400 processes I waited until there were no more wget processes before I started rendering more. My load gets up above 20 on my dual core, which is about as hard as I should push it before the load is counterproductive. It seems to have trimmed a couple of minutes off of my WEBrick sequential rendering.


People:
Places:
Things:
mcj
Using MCJ to Practice SQL Commands - Part 1 - Initial Startup
Times:





Please read our Terms of Use and our Privacy Policy
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2011 NetAdminTools.com