Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'mysql2'
- require 'sequel'
- CONF = {
- adapter: 'mysql2',
- encoding: 'utf8',
- username: 'ruby',
- password: 'ruby',
- host: 'localhost',
- port: 3306,
- pool: 4,
- read_timeout: 10,
- write_timeout: 10,
- connect_timeout: 10,
- pool_timeout: 10,
- database: 'demo',
- max_conns: 7
- }
- conn = Sequel.connect(CONF)
- t = Thread.new { conn['select sleep(100)'].all }
- sleep 2
- t.kill
- sleep 15
- SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND != 'Sleep'
Add Comment
Please, Sign In to add comment