mercoledì 5 ottobre 2011

JMeter Notes


  • Thread group: number of users involved in the simulation

  • HttpRequest properties

giovedì 2 dicembre 2010

How to deal with connection

One of the typical failures using Mysql in conjunction with some Servlet Container, is getting sometimes this stacktrace:

javax.servlet.ServletException: javax.servlet.jsp.JspException: SELECT * FROM clips limit 0,10; : The last packet successfully received from the server was41768 seconds ago.The last packet sent successfully to the server was 41768 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem

Well... the hint that this nice error message gives you is just bullshit! As far as I know the option autoReconnect=true is deprecated and doesn't work properly.

The way to avoid this is to stick this code



driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30"
maxWait="120000" minEvictableIdleTimeMillis="240000" name="jdbc/yourdatabase"
password="ged2tryp" removeAbandoned="true" testOnBorrow="false"
testWhileIdle="true" timeBetweenEvictionRunsMillis="40000"
type="javax.sql.DataSource"
url="jdbc:mysql://yourIP:3306/yourdatabase?zeroDateTimeBehavior=convertToNull"
useUnicode="yes" username="yourUsername" validationQuery="SELECT 1"/>