Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 186 lines (117 sloc) 4.02 kb
ceb8ca4 Ben Browning Add Spree Rails3 application
bbrowning authored
1 # TorqueBox Setup
2
3 Install prerequisite gems
4
5 cd /mnt/data/speedmetal/apps/rails3/spree
6 jruby -S bundle install
7
8 Migrate database and load default data
9
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
10 sudo yum install -y ImageMagick
ceb8ca4 Ben Browning Add Spree Rails3 application
bbrowning authored
11 RAILS_ENV=production jruby -S rake db:bootstrap
12
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
13 When prompted to load sample data during db:bootstrap, choose yes.
14
ceb8ca4 Ben Browning Add Spree Rails3 application
bbrowning authored
15 Create a deployment descriptor
16
17 rm -f $JBOSS_HOME/standalone/deployments/*-knob*
18 cat << EOF > $JBOSS_HOME/standalone/deployments/spree-knob.yml
19 ---
20 application:
21 root: /mnt/data/speedmetal/apps/rails3/spree/
22 env: production
23 web:
24 context: /
25 EOF
26 touch $JBOSS_HOME/standalone/deployments/spree-knob.yml.dodeploy
27
28 Start TorqueBox
29
30 screen
cc2e7e9 Ben Browning Add ImageMagick install command for spree
bbrowning authored
31 $JBOSS_HOME/bin/standalone.sh -Djboss.bind.address=0.0.0.0 -Dorg.torquebox.web.http.maxThreads=100
3a2192f Ben Browning Add Passenger to spree README.md
bbrowning authored
32
33
34
f616ed1 Ben Browning Add TorqueBox 1.x instructions
bbrowning authored
35 # TorqueBox 1.x Setup
36
37 Install prerequisite gems
38
39 cd /mnt/data/speedmetal/apps/rails3/spree
40 jruby -S bundle install
41
42 Migrate database and load default data
43
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
44 sudo yum install -y ImageMagick
f616ed1 Ben Browning Add TorqueBox 1.x instructions
bbrowning authored
45 RAILS_ENV=production jruby -S rake db:bootstrap
46
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
47 When prompted to load sample data during db:bootstrap, choose yes.
48
f616ed1 Ben Browning Add TorqueBox 1.x instructions
bbrowning authored
49 Create a deployment descriptor
50
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
51 rm -f $JBOSS_HOME/server/default/deploy/*-knob.yml
52 cat << EOF > $JBOSS_HOME/server/default/deploy/spree-knob.yml
f616ed1 Ben Browning Add TorqueBox 1.x instructions
bbrowning authored
53 ---
54 application:
55 root: /mnt/data/speedmetal/apps/rails3/spree/
56 env: production
57 web:
58 context: /
59 EOF
60
61 Edit $JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml and add
62 maxThreads="100" to the port 8080 HTTP connector element.
63
64 Start TorqueBox
65
66 screen
67 $JBOSS_HOME/bin/run.sh -b 0.0.0.0
68
69
70
5d62923 Ben Browning Add Trinidad instructions for Spree
bbrowning authored
71 # Trinidad Setup
72
73 Install prerequisite gems
74
75 cd /mnt/data/speedmetal/apps/rails3/spree
76 jruby -S gem install bundler
77 jruby -S bundle install
78
79 Migrate database and load default data
80
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
81 sudo yum install -y ImageMagick
5d62923 Ben Browning Add Trinidad instructions for Spree
bbrowning authored
82 RAILS_ENV=production jruby -S rake db:bootstrap
83
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
84 When prompted to load sample data during db:bootstrap, choose yes.
85
5d62923 Ben Browning Add Trinidad instructions for Spree
bbrowning authored
86 ## Write Trinidad Config File
87
88 cat << EOF > /tmp/trinidad.yml
89 ---
90 http:
91 maxThreads: 100
92 EOF
93
94 Start Trinidad
95
96 screen
97 jruby -J-Xmx2048m -S trinidad -p 8080 -e production -t --config /tmp/trinidad.yml
98
99
100
3a2192f Ben Browning Add Passenger to spree README.md
bbrowning authored
101 # Passenger Setup
102
103 Install prerequisite gems
104
105 sudo yum install -y mysql-libs mysql-devel sqlite-devel
106 cd /mnt/data/speedmetal/apps/rails3/spree
107 sudo gem install bundler
108 bundle install
109
110 Migrate database and load default data
111
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
112 sudo yum install -y ImageMagick
3a2192f Ben Browning Add Passenger to spree README.md
bbrowning authored
113 RAILS_ENV=production rake db:bootstrap
114
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
115 When prompted to load sample data during db:bootstrap, choose yes.
116
3a2192f Ben Browning Add Passenger to spree README.md
bbrowning authored
117 Start Passenger
118
119 screen
120 passenger start -p 8080 -e production --max-pool-size 50
8c360d7 Ben Browning Update spree README.md
bbrowning authored
121
122
123
44aa8ae Ben Browning Add unicorn spree instructions
bbrowning authored
124 # Unicorn Setup
125
126 Install prerequisite gems
127
128 sudo yum install -y mysql-libs mysql-devel sqlite-devel
129 cd /mnt/data/speedmetal/apps/rails3/spree
130 sudo gem install bundler
4d2cf23 Ben Browning Unicorn needs uninstallation of newer rack
bbrowning authored
131 sudo gem uninstall rack -v=1.3.4
44aa8ae Ben Browning Add unicorn spree instructions
bbrowning authored
132 bundle install
133
134 Migrate database and load default data
135
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
136 sudo yum install -y ImageMagick
44aa8ae Ben Browning Add unicorn spree instructions
bbrowning authored
137 RAILS_ENV=production rake db:bootstrap
138
d68313f Ben Browning I always forget to install ImageMagick so make it more explicit
bbrowning authored
139 When prompted to load sample data during db:bootstrap, choose yes.
140
44aa8ae Ben Browning Add unicorn spree instructions
bbrowning authored
141 Write config file
142
143 cat << EOF > /tmp/unicorn.rb
144 worker_processes 50
145 preload_app true
146 timeout 30
147 listen 8080, :backlog => 2048
148
149 # REE-friendly
150 if GC.respond_to?(:copy_on_write_friendly=)
151 GC.copy_on_write_friendly = true
152 end
153
154 before_fork do |server, worker|
155 ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base)
156 end
157
158 after_fork do |server, worker|
159 ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
160 end
161 EOF
162
163 Start Unicorn
164
f616ed1 Ben Browning Add TorqueBox 1.x instructions
bbrowning authored
165 screen
44aa8ae Ben Browning Add unicorn spree instructions
bbrowning authored
166 unicorn_rails -E production -c /tmp/unicorn.rb
167
168
169
8c360d7 Ben Browning Update spree README.md
bbrowning authored
170 # Run Benchmark
171
172 From Tsung machine, test app is running via curl
173
174 curl http://server:8080/
175
176 Then verify you can ssh into the server and localhost without a
177 password
178
179 ssh server
180 ssh localhost
181
182 Finally, kick off the benchmark
183
184 screen
185 tsung -f /home/ec2-user/speedmetal/apps/rails3/spree/tsung.xml start
Something went wrong with that request. Please try again.