[Contrib] Python-based alternative for clustercheck and xinetd

Bug #1177262 reported by Raghavendra D Prabhu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Fix Released
Undecided
Raghavendra D Prabhu

Bug Description

This bug is to track the python-based script contributed by
dbusby here - https://github.com/Oneiroi/clustercheck

Related branches

no longer affects: codership-mysql
Revision history for this message
David Busby (d-busby) wrote :

Updated now has basic flag set / unset to prevent cache storming,

`ab -c 200 -n 1000 http://localhost:8000`

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software: BaseHTTP/0.3
Server Hostname: localhost
Server Port: 8000

Document Path: /
Document Length: 57 bytes

Concurrency Level: 200
Time taken for tests: 0.494 seconds
Complete requests: 1000
Failed requests: 999
   (Connect: 0, Receive: 0, Length: 999, Exceptions: 0)
Write errors: 0
Non-2xx responses: 1000
Total transferred: 183007 bytes
HTML transferred: 50007 bytes
Requests per second: 2023.19 [#/sec] (mean)
Time per request: 98.854 [ms] (mean)
Time per request: 0.494 [ms] (mean, across all concurrent requests)
Transfer rate: 361.58 [Kbytes/sec] received

Connection Times (ms)
              min mean[+/-sd] median max
Connect: 0 0 1.1 0 12
Processing: 1 3 21.5 2 482
Waiting: 1 3 21.5 1 482
Total: 2 3 22.0 2 494

Percentage of the requests served within a certain time (ms)
  50% 2
  66% 2
  75% 2
  80% 2
  90% 2
  95% 2
  98% 2
  99% 3
 100% 494 (longest request)

Revision history for this message
Jay Janssen (jay-janssen) wrote :

Heh -- and how much did 'Com_show_status' and 'Com_show_variables' grow on the server? ;)

Changed in percona-xtradb-cluster:
milestone: none → 5.5.30-24.8
Revision history for this message
David Busby (d-busby) wrote :

Repo created: https://github.com/Oneiroi/clustercheck gist will no longer be maintained

Changed in percona-xtradb-cluster:
assignee: nobody → Raghavendra D Prabhu (raghavendra-prabhu)
status: New → In Progress
Changed in percona-xtradb-cluster:
status: In Progress → Fix Committed
Revision history for this message
David Busby (d-busby) wrote :

@Jay

retest single PXC local node, fresh install not configured

dbusby@icleus-oneiroi-co-uk ~/Documents/Projects/Github/clustercheck$ sudo service mysql restart 1 ↵ master
Shutting down MySQL (Percona XtraDB Cluster).... [ OK ]
Starting MySQL (Percona XtraDB Cluster)......... [ OK ]
 mysql -Bse 'show global status like "Com_show_status"; show global status like "Com_show_variables"' master
Com_show_status 1
Com_show_variables 0

python clustercheck.py
...
localhost.localdomain - - [13/May/2013 12:45:16] "GET / HTTP/1.0" 503 -
localhost.localdomain - - [13/May/2013 12:45:18] "GET / HTTP/1.0" 503 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 36304)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python2.7/SocketServer.py", line 638, in __init__
    self.handle()
  File "/usr/lib64/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib64/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "clustercheck.py", line 48, in do_GET
    curs = conn.cursor()
UnboundLocalError: local variable 'conn' referenced before assignment
----------------------------------------
^CTraceback (most recent call last):
  File "clustercheck.py", line 98, in <module>
    httpd.serve_forever()
  File "/usr/lib64/python2.7/SocketServer.py", line 225, in serve_forever
    r, w, e = select.select([self], [], [], poll_interval)
KeyboardInterrupt
...
dbusby@icleus-oneiroi-co-uk ~/Documents/Projects/Github/clustercheck$ mysql -Bse 'show global status like "Com_show_status"; show global status like "Com_show_variables"' 1 ↵ master
Com_show_status 3
Com_show_variables 0

Patching this bug, lines 41 -> 46 presently handle a connection error to MySQL but at line 48 the conn var is attempted to be used regardless of failiure.

Revision history for this message
David Busby (d-busby) wrote :

Fix in place, albeit quick and dirty fix: https://github.com/Oneiroi/clustercheck/commit/8e327ac21e17c0c7b7a1eb2746693010e127ee12

...
localhost.localdomain - - [13/May/2013 12:52:32] "GET / HTTP/1.0" 503 -
localhost.localdomain - - [13/May/2013 12:52:32] "GET / HTTP/1.0" 503 -
localhost.localdomain - - [13/May/2013 12:53:09] "GET / HTTP/1.0" 503 -
----------------------------------------
^CTraceback (most recent call last):
  File "clustercheck.py", line 102, in <module>
    httpd.serve_forever()
  File "/usr/lib64/python2.7/SocketServer.py", line 225, in serve_forever
    r, w, e = select.select([self], [], [], poll_interval)
KeyboardInterrupt
dbusby@icleus-oneiroi-co-uk ~/Documents/Projects/Github/clustercheck$ mysql -Bse 'show global status like "Com_show_status"; show global status like "Com_show_variables"' 1 ↵ ✹master
Com_show_status 3
Com_show_variables 0

Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released
David Busby (d-busby)
description: updated
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1342

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.