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)的更多相关文章

  1. basic use of sidekiq

    参考页面 https://github.com/mperham/sidekiq https://github.com/mperham/sidekiq/wiki/Getting-Started 强烈推荐 ...

  2. Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结

    Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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#? ...

随机推荐

  1. Java NIO (转)

    Java NIO提供了与标准IO不同的IO工作方式: Channels and Buffers(通道和缓冲区):标准的IO基于字节流和字符流进行操作的,而NIO是基于通道(Channel)和缓冲区(B ...

  2. ActiveMQ笔记(4):搭建Broker集群(cluster)

    上一篇介绍了基于Networks of Borkers的2节点HA方案,这一篇继续来折腾Networks of Brokers,当应用规模日渐增长时,2节点的broker可能仍然抗不住访问压力,这时候 ...

  3. docker学习(7) docker-compose使用示例

    上一回学习了如何利用docker搭建一个mysql + java service + nginx,总共4个docker容器,如果采用docker run的方式一个一个容器去创建十分麻烦.为了能更高效的 ...

  4. Backbone.js应用基础

    前言: Backbone.js是一款JavaScript MVC应用框架,强制依赖于一个实用型js库underscore.js,非强制依赖于jquery:其主要组件有模型,视图,集合,路由:与后台的交 ...

  5. curl的登录总结

    demo1 <?php $curl=curl_init('http://www.baidu.com'); curl_exec($curl); curl_close($curl); ?> c ...

  6. js-读取复选框

    js: var obj = document.getElementsByName("yk"); var check_val = []; for(k in obj){ if(obj[ ...

  7. 数据库中char与varchar类型的区别

    在建立数据库表结构的时候,为了给一个String类型的数据定义一个数据库的数据库类型,一般参考的都是char或者varchar,这两种选择有时候让人很纠结,今天想总结一下它们两者的区别,明确一下选择塔 ...

  8. matlab中数组创建方法

    创建数组可以使用 分号 :  逗号, 空格 数组同行用 逗号,或空格分割 不同行元素用 分号: clc; a = [ ]; b1 = a();%第3个元素 b2 = a(:)%第2//4个元素 b3 ...

  9. matlab中pcolorh函数作用

    就是说X,Y是用来定位的,C是用来填充颜色的.参数C要求至少是一个矩阵,而参数X,Y可以是向量,也可以是矩阵.当X,Y是向量时,X与C的行对应,Y与C的列对应,因此向量X与Y的维数必须要求与C的行与列 ...

  10. java 在循环中删除数组元素

    在写代码中经常会遇到需要在数组循环中删除数组元素的情况,但删除会导致数组长度变化. package com.fortunedr.thirdReport; import java.util.ArrayL ...