This tutorial provides a means to enable slow query logs on MySQL.
Enable these on AWS RDS Parameter Groups.
slow_query_log: 1
long_query_time: 10
#!/bin/bash | |
# Usage: threaddump.sh <thread count threshold> <process name> | |
# Example: | |
# Run this command `nohup sh threaddump.sh 500 tomcat7 &` to capture a thread | |
# dump when httpd connections exceeds 500. | |
# | |
# Logs are written to `nohump.out` in the users home directory. | |
# Thread dump for tomcat will be written to `/var/log/tomcat7/catalina.out`. |
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
VPC: | |
Type: 'AWS::EC2::VPC' | |
Properties: | |
CidrBlock: 10.0.0.0/16 | |
InternetGateway: | |
Type: 'AWS::EC2::InternetGateway' | |
GatewayToInternet: | |
Type: 'AWS::EC2::VPCGatewayAttachment' |
@Override
Annodation
Unit tests should always be deterministic / reproducable. It is hard to debug when tests might fail randomly.
Unit tests should always follow the same execution path, and hit all asserts regardless of the global or local state. This ensures consistent behaviour and that there is no assumptions on whether conditional control flows have been accurately written.
Tutorial: http://mauveweb.co.uk/posts/2014/07/gevent-asynchronous-io-made-easy.html
Exception example: RuntimeError('application not registered on db instance and no application bound to current context',)
The app context is not transfered between threads / greenlets. Please see: