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#? ...
随机推荐
- centos系统编译安装nginx+php环境另加独立mysql教程
以前看过的安装nginx+php环境都带了mysql数据库了,这个是因为很多站长都是nginx+php+mysql都在同一台服务器了,那么今天我们是单独处理了,一个是nginx+php环境,然后mys ...
- [LeetCode] Valid Perfect Square 检验完全平方数
Given a positive integer num, write a function which returns True if num is a perfect square else Fa ...
- android studio 不能创建或者安装模拟器
解决方法: (1).对与这类问题实在不行卸载然后安装,看看自己的网络是否把android studio下载的东西给墙了,墙了记得换网. (2).我安装andriod studio 2.2.2.0 版本 ...
- mysq大数据分页
mysql limit大数据量分页优化方法 Mysql的优化是非常重要的.其他最常用也最需要优化的就是limit.Mysql的limit给分页带来了极大的方便,但数据量一大的时候,limit的性能就急 ...
- Redux原理(一):Store实现分析
写在前面 写React也有段时间了,一直也是用Redux管理数据流,最近正好有时间分析下源码,一方面希望对Redux有一些理论上的认识:另一方面也学习下框架编程的思维方式. Redux如何管理stat ...
- Ubuntu中配置Java环境变量时,出现command not found问题解决记录
百度出Ubuntu中配置Java环境变量时,在利用sudo gedit /etc/profile 对profile编辑后, 在terminal中输入 sudo source /etc/profile, ...
- 贝赛尔曲线UIBezierPath
使用UIBezierPath类可以创建基于矢量的路径,这个类在UIKit中.此类是Core Graphics框架关于path的一个封装.使用此类可以定义简单的形状,如椭圆或者矩形,或者有多个直线和曲线 ...
- Beta版本冲刺第七天
Aruba 408 409 410 428 429 431 完成任务: 新增:完成文字导出为图片并改善画布大小 改进:适应MIUI系统相册选图 改进:调整activity间的跳转逻辑 改进:调整编辑窗 ...
- 以最简单方式学习Linux
有很多关于Linux的书籍,博客.大多数都会比较"粗暴"的将一大堆的命令塞给读者,从而使很多.NET程序员望而却步.未入其门就路过了. 所以我设想用一种更为平滑的学习方式, 就是在 ...
- PHP编码规范PSR-2
.note-content { font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeit ...