basic use of sidekiq (2)
vim Gemfile
source "https://rubygems.org" gem "sidekiq"gem 'rack-protection'
gem "sinatra"
vim config.ru
require 'sidekiq'
require 'rack-protection' Sidekiq.configure_client do |config|
config.redis = { db: 1 }
end require 'sidekiq/web'
run Sidekiq::Web
执行
(1)方法1
bundle exec sidekiq
打开页面当前项目下启动http://localhost:3000/sidekiq
(2)
方法2
$ rackup
打开管理页面就可以看到了所有的任务了
http://localhost:9292/
可以在sidekiq启动的时候存入任务进程号
$bundle exec sidekiq -r ./worker.rb -P ~/tmp/sidekiq.pid
$cat ~/tmp/sidekiq.pid
1198
$ ps -ax | grep sidekiq
1198 pts/28 Sl+ 0:00 sidekiq 4.1.1 [0 of 25 busy]
1259 pts/33 S+ 0:00 grep --color=auto sidekiq
可以使用sidekiqctl关闭服务
$ sidekiqctl --help
sidekiqctl - stop a Sidekiq process from the command line. Usage: sidekiqctl <command> <pidfile> <kill_timeout>
where <command> is either 'quiet' or 'stop'
<pidfile> is path to a pidfile
<kill_timeout> is number of seconds to wait until Sidekiq exits
(default: 10), after which Sidekiq will be KILL'd Be sure to set the kill_timeout LONGER than Sidekiq's -t timeout. If you want
to wait 60 seconds for jobs to finish, use `sidekiq -t 60` and `sidekiqctl stop
path_to_pidfile 61`
$ sidekiqctl stop ~/tmp/sidekiq.pid
Sidekiq shut down gracefully.
basic use of sidekiq (2)的更多相关文章
- basic use of sidekiq
参考页面 https://github.com/mperham/sidekiq https://github.com/mperham/sidekiq/wiki/Getting-Started 强烈推荐 ...
- Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结
Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...
- Basic Tutorials of Redis(9) -First Edition RedisHelper
After learning the basic opreation of Redis,we should take some time to summarize the usage. And I w ...
- Basic Tutorials of Redis(8) -Transaction
Data play an important part in our project,how can we ensure correctness of the data and prevent the ...
- Basic Tutorials of Redis(7) -Publish and Subscribe
This post is mainly about the publishment and subscription in Redis.I think you may subscribe some o ...
- Basic Tutorials of Redis(6) - List
Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with t ...
- Basic Tutorials of Redis(5) - Sorted Set
The last post is mainly about the unsorted set,in this post I will show you the sorted set playing a ...
- Basic Tutorials of Redis(4) -Set
This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...
- Basic Tutorials of Redis(3) -Hash
When you first saw the name of Hash,what do you think?HashSet,HashTable or other data structs of C#? ...
随机推荐
- servlet过滤器使用
servlet的过滤器夹在用户和servlet之间,可以截获并预处理或者打断{用户到servlet的请求或servlet到用户的响应},但本身并不能处理和响应用户请求. filter类必须实现Filt ...
- [LeetCode] Count Complete Tree Nodes 求完全二叉树的节点个数
Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from W ...
- IOS跑马灯效果,实现文字水平无间断滚动
ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController{ NSTimer ...
- 使用SVG图像作为loading加载 以保证图像高清不模糊
使用教程 接下来设计达人网小编为大家讲解这个使用方法,其实是相当简单的. STEP 1: 复制你想要的SVG加载动画代码到<body>里面,小编随意复制一个代码如下:<svg ver ...
- C++ 自由存储区是否等价于堆?
"free store" VS "heap" 当我问你C++的内存布局时,你大概会回答: "在C++中,内存区分为5个区,分别是堆.栈.自由存储区.全 ...
- time step和采样频率的关系
当前的采样频率为11025HZ,overlap=0.5,取的是1024个采样点为1帧.则time step为256时的时间长度为11秒.即以11秒为单位分割原始的音频,生成一张语普图. >> ...
- 【BZOJ-3270】博物馆 高斯消元 + 概率期望
3270: 博物馆 Time Limit: 30 Sec Memory Limit: 128 MBSubmit: 292 Solved: 158[Submit][Status][Discuss] ...
- Xamarin.ios 调用接口
NSString urlstring = new NSString("http://211.155.229.230:8585/api/users/postregister"); ...
- 在windows下使用linux命令,GnuWin32的使用.
http://sourceforge.net/projects/getgnuwin32 使用过linxu的伙计估计都会喜欢上linux各种各样强大的命令如:grep, sed,awk,diff和pat ...
- thinkphp3.2.3中U()方法和redirect()方法区别
今天博主看3.1的教程,学着3.2,就遇到了这个坑,怎么就是不跳转呢,很纳闷!! 在thinkphp3.1 中 U()方法是可以执行跳转的(看视频教程里面是可以的,博主没有测试过). 但是在think ...