Guest User

Untitled

a guest
Dec 19th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'mysql2'
  4. require 'sequel'
  5.  
  6. CONF = {
  7. adapter: 'mysql2',
  8. encoding: 'utf8',
  9. username: 'ruby',
  10. password: 'ruby',
  11. host: 'localhost',
  12. port: 3306,
  13. pool: 4,
  14. read_timeout: 10,
  15. write_timeout: 10,
  16. connect_timeout: 10,
  17. pool_timeout: 10,
  18. database: 'demo',
  19. max_conns: 7
  20. }
  21.  
  22. conn = Sequel.connect(CONF)
  23.  
  24. t = Thread.new { conn['select sleep(100)'].all }
  25. sleep 2
  26.  
  27. t.kill
  28. sleep 15
  29.  
  30. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND != 'Sleep'
Add Comment
Please, Sign In to add comment