Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Cookbook GitLab
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.org
Cookbook GitLab
Commits
e2202625
Commit
e2202625
authored
Dec 03, 2013
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend unicorn attributes.
parent
c0d7da52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
attributes/default.rb
attributes/default.rb
+9
-3
recipes/monit.rb
recipes/monit.rb
+6
-1
templates/default/unicorn.monitrc.erb
templates/default/unicorn.monitrc.erb
+2
-2
No files found.
attributes/default.rb
View file @
e2202625
...
...
@@ -104,8 +104,8 @@ default['gitlab']['aws'] = {
:endpoint
=>
'https://s3.example.com:8080'
# optional, defaults to nil
}
default
[
'gitlab'
][
'monitrc'
][
'
unicorn
'
]
=
{
:pid_path
=>
"
#{
default
[
'gitlab'
][
'path'
]
}
/tmp/pids/
unicorn
.pid"
,
default
[
'gitlab'
][
'monitrc'
][
'
sidekiq
'
]
=
{
:pid_path
=>
"
#{
default
[
'gitlab'
][
'path'
]
}
/tmp/pids/
sidekiq
.pid"
,
:start_timeout
=>
"80"
,
# in seconds
:stop_timeout
=>
"40"
,
# in seconds
:cpu_threshold
=>
"40"
,
# in %
...
...
@@ -116,5 +116,11 @@ default['gitlab']['monitrc']['unicorn'] = {
:restart_cycles_number
=>
"5"
# Number of cycles to monitor for consecutive restarts.
}
default
[
'gitlab'
][
'monitrc'
][
'sidekiq_pid_path'
]
=
"
#{
default
[
'gitlab'
][
'path'
]
}
/tmp/pids/sidekiq.pid"
default
[
'gitlab'
][
'monitrc'
][
'unicorn'
]
=
{
:pid_path
=>
"
#{
default
[
'gitlab'
][
'path'
]
}
/tmp/pids/unicorn.pid"
,
:mem_threshold
=>
"1000.0"
,
# in MB
:mem_cycles_number
=>
"25"
,
:cpu_threshold
=>
"80"
,
# in %
:cpu_cycles_number
=>
"50"
}
default
[
'gitlab'
][
'monitrc'
][
'notify_email'
]
=
"monitrc@localhost"
recipes/monit.rb
View file @
e2202625
...
...
@@ -25,11 +25,16 @@ monit_monitrc "sidekiq" do
})
end
unicorn
=
monitrc
[
'unicorn'
]
monit_monitrc
"unicorn"
do
variables
({
gitlab_user:
gitlab
[
'user'
],
gitlab_path:
gitlab
[
'path'
],
unicorn_pid_path:
monitrc
[
'unicorn_pid_path'
],
unicorn_pid_path:
unicorn
[
'pid_path'
],
mem_threshold:
unicorn
[
'mem_threshold'
],
mem_cycles_number:
unicorn
[
'mem_cycles_number'
],
cpu_threshold:
unicorn
[
'cpu_threshold'
],
cpu_cycles_number:
unicorn
[
'cpu_cycles_number'
],
notify_email:
monitrc
[
'notify_email'
]
})
end
...
...
templates/default/unicorn.monitrc.erb
View file @
e2202625
...
...
@@ -2,5 +2,5 @@ check process unicorn with pidfile <%= @unicorn_pid_path %>
alert
<%=
@notify_email
%>
but not on { ppid }
start program = "/bin/cat /dev/null"
stop program = "/bin/su -
<%=
@gitlab_user
%>
-c 'RAILS_ENV=production
<%=
@gitlab_path
%>
/script/web reload'"
if totalmem is greater than
1000.0 MB for 25
cycles then restart
if
cpu is greater than 80% for 50
cycles then restart
if totalmem is greater than
<%=
@mem_threshold
%>
MB for
<%=
@mem_cycles_number
%>
cycles then restart
if
totalcpu is greater than
<%=
@cpu_threshold
%>
% for
<%=
@cpu_cycles_number
%>
cycles then restart
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment