-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
235 lines (207 loc) · 9.34 KB
/
index.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />
<title>Sidekiq Heroku Redis calculator</title>
<!-- Included CSS Files (Compressed) -->
<link rel="stylesheet" href="content/stylesheets/foundation.min.css">
<link rel="stylesheet" href="content/stylesheets/app.css">
<!-- FontAwesome -->
<link rel="stylesheet" href="content/stylesheets/font-awesome.css">
<!--[if IE 7]>
<link rel="stylesheet" href="assets/css/font-awesome-ie7.css">
<![endif]-->
<script src="content/javascripts/modernizr.foundation.js"></script>
<script src="content/javascripts/prettify.min.js"></script>
<!-- IE Fix for HTML5 Tags -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="twelve columns">
<h1>S<small>idekiq</small>H<small>eroku</small>R<small>edis calculator</small></h1>
<h5 class="subheader"> <code>Redis connection</code> and <code>concurrencies</code> calculator for hosting <a href="http://mperham.github.com/sidekiq/">Sidekiq</a> on <a href="http://www.heroku.com">Heroku</a> with <a href="https://addons.heroku.com/redistogo">Redis to Go</a></h5>
<p>Simple calculator to calculate how many <code>concurrencies</code> and <code>Redis connections</code> you have to define for working with on <p>
<hr />
</div>
</div>
<div class="row">
<div class="twelve columns">
<form class="custom">
<div class="row">
<div class="three mobile-one columns">
<label class="right inline">Redis To Go instance:</label>
</div>
<div class="nine mobile-three columns">
<div class="row">
<div class="two columns">
<label for="radio_nano" class="inline instance_type">
<input name="instance" checked="checked" type="radio" id="radio_nano" style="display:none;" value="10" />
<span class="custom radio"></span> Nano<small> 10</small>
</label>
</div>
<div class="two columns">
<label for="radio_mini" class="inline instance_type">
<input name="instance" type="radio" id="radio_mini" style="display:none;" value="50" />
<span class="custom radio"></span> Mini <small>50</small>
</label>
</div>
<div class="two columns">
<label for="radio_small" class="inline instance_type">
<input name="instance" type="radio" id="radio_small" style="display:none;" value="256" />
<span class="custom radio"></span> Small <small>256</small>
</label>
</div>
<div class="two columns">
<label for="radio_medium" class="inline instance_type">
<input name="instance" type="radio" id="radio_medium" style="display:none;" value="512" />
<span class="custom radio"></span> Medium <small>512</small>
</label>
</div>
<div class="two columns">
<label for="radio_large" class="inline instance_type">
<input name="instance" type="radio" id="radio_large" style="display:none;" value="1024" />
<span class="custom radio"></span> Large <small>1024</small>
</label>
</div>
<div class="two columns">
<input type="number" value="10" id="max_connections" class="eight" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="three mobile-one columns">
<label class="right inline range">Heroku Dynos:</label>
</div>
<div class="nine mobile-three columns">
<div class="row">
<div class="four columns">
<label for="web" class="inline">
<span class="radius label">Web</span><br />
<input type="range" min="1" max="100" value="0" step="1" />
<input type="number" value="1" id="dyno_web" class="three" />
</label>
</div>
<div class="four columns">
<label for="web" class="inline">
<span class="radius label">Worker (used for Sidekiq)</span><br />
<input type="range" min="1" max="100" value="0" step="1" />
<input type="number" value="1" id="dyno_worker" class="three" />
</label>
</div>
<div class="four columns"> </div>
</div>
</div>
</div>
<div class="row">
<div class="three mobile-one columns">
<label class="right inline">Web threads:</label>
</div>
<div class="nine mobile-three columns">
<div class="row">
<div class="four columns">
<input type="range" min="1" max="100" value="0" step="1" />
<input type="number" value="1" id="web_threads" class="three" />
</div>
<div class="eight columns">
<p class="small">If you're using Unicorn, you have to fill in the number you've defined in <code>worker_processes</code> from your <code>app/config/unicorn.rb</code> file.</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="three mobile-one columns">
<label class="right inline">Redis client connection size:</label>
</div>
<div class="nine mobile-three columns">
<div class="row">
<div class="two columns">
<input type="number" id="redis_client_connections" value="1" />
</div>
<div class="eight columns offset-by-two">
<p class="small">Number of connections per Web dyno, (per Unicorn worker) <em>minimum 1</em>. Only change this value if you query the Redis database more than just for adding tasks to the Sidekiq queue.</p>
</div>
</div>
</div>
</div>
</form>
</div>
<hr />
</div>
<div class="row">
<div class="three columns">
<ul class="pricing-table">
<li class="title">Sidekiq concurrencies</li>
<li class="price" id="concurrency"></li>
</ul>
<ul class="pricing-table">
<li class="title">Sidekiq server connections</li>
<li class="price" id="server_connection_size"></li>
</ul>
</div>
<div class="five columns code_block">
<pre class="prettyprint languague-ruby" id="code_initializer">
# app/config/initializers/sidekiq.rb
require 'sidekiq'
Sidekiq.configure_client do |config|
config.redis = { :size => 0 }
end
Sidekiq.configure_server do |config|
# The config.redis is calculated by the
# concurrency value so you do not need to
# specify this. For this demo I do
# show it to understand the numbers
config.redis = { :size => 0 }
end
</pre>
</div>
<div class="four columns code_block">
<pre class="prettyprint languague-yaml" id="code_concurrency">
# app/config/sidekiq.yml
:concurrency: 0
</pre>
<p class="panel" style="margin-top: 10px;"><strong>Note</strong>: You might also need to increase the pool size of your AR database.<br />See: <a href="https://github.com/mperham/sidekiq/wiki/Advanced-Options">Advanced Options - Concurrency</a>
</div>
</div>
<!-- Footer -->
<footer class="row">
<div class="twelve columns">
<hr />
<div class="row">
<div class="six columns">
<p>© Copyright by <a href="http://manuel.manuelles.nl/">Manuel van Rijn</a>.</p>
</div>
<div class="six columns">
<ul class="link-list right">
<li><a href="http://manuel.manuelles.nl/blog/2012/11/13/sidekiq-on-heroku-with-redistogo-nano/">Blog post</a></li>
</ul>
</div>
</div>
</div>
</footer>
<!-- Included JS Files (Compressed) -->
<script src="content/javascripts/foundation.min.js"></script>
<!-- Initialize JS Plugins -->
<script src="content/javascripts/app.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17149124-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>