My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env ruby
require 'rubygems'
$:.unshift '/Users/rogerpack/dev/ramaze_git/lib'
$:.unshift File.dirname(__FILE__) + '/../'
require 'ramaze'
def dbg; require 'ruby-debug'; debugger; end


# to see that this works, ruby start.rb, then
# compare the timing of
# time ab -n 50 -c 10 http://127.0.0.1:7000/mixed_old_school
# time ab -n 50 -c 10 http://127.0.0.1:7000/mixed_new_school




use_evented_and_fibered = true
if use_evented_and_fibered

# in order to use evented with 1.9, you actually need to go into your mongrel itself and require 'swiftcore/evented_mongrel' at the end of it,
# and then require '../fibered_mongrel.rb' after that
# this to overcome a bug in Ramaze
# in my own code, I set it to load these files if I had defined certain constants

EVENTED_MONGREL = true
EVENTED_FIBERED_MONGREL = true
# this causes the err on 1.9 require 'swiftcore/evented_mongrel'
# also note that
# you'll need to go into ramaze and discourage it from starting a thread with each response [since we use fibers to supplant threads]
# i.e. go into lib/ramaze/adapter/base.rb
# and change def respond [at the bottom]
# to not spawn them
#
# def respond(env)
# if false #Global.server.respond_to?(:thread) and Global.server.thread == Thread.current # changed line
# ...

end

# require all controllers and models
acquire __DIR__/:controller/'*'
acquire __DIR__/:model/'*'

Ramaze.start :adapter => :evented_mongrel, :port => 7000 # you may need the svn version of ramaze for :evented_mongrel to work here

Show details Hide details

Change log

r113 by rogerpack2005 on Jul 03, 2008   Diff
ramaze init
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1559 bytes, 45 lines

File properties

svn:executable
*
Hosted by Google Code