Wednesday, March 05, 2008

A quick howto to setup JMeter

JMeter is an open source load testing tool, it's pretty easy to get up
and running and it's quite fun to test and break things on your own server.

Here's a quick getting started guide on how to record a simple test plan.

Download and install JMeter

Open Jmeter (bin/Jmeter.bat on Windows)

Add (via right click) a Thread group to the Test Plan

Add a Non Test Element > HTTP Proxy Server to the Workbench

Open the HTTP Proxy Server Page and change the port if required

Set the Target Controller to Test Plan > Thread Group on the same page



Configure your browser (Firefox!) to use the Proxy Server (it's localhost)

Press Start at the bottom of the page

Now, JMeter will record all the HTTP requests your browser makes, so make sure you have closed all the other tabs you have open, otherwise you will get a mixture of Ad's and ajax requests recorded as well.

As an example, tonight I was doing some load testing on the Tile service for Mapguide, so I opened a map and zoomed in and panned around a bit. Then I pressed Stop in JMeter and I had a list of HTTP requests. Simple!

Don't forget to reset your browser proxy settings!



You can delete any requests you don't want from the list at any time.

Add a Timer > Gaussian Random Timer to the Thread Group which will make the requests random.

Add a Listener > Aggregate Report to the Test Plan

Now for the first run, the default load setting is fine.

Select the Aggregate Report and the from the top menu click Run > Start



If that worked out ok and there are no errors, you can the configure the thread group to run multiple times with multiple users. You can see I had an error rate of 100% in the example above.



If you get errors, check your webserver and application server logs. You can also log and view each http request and response using Listener > View Results in Table. Filtering to only show errors is also helpful.




If you are running a big load test, remember each Listener keeps a copy of the results in memory so you might be better running a Listener > Simple Data Writer instead which writes the results out to a file. You can then read the file in later into any of the reports.

Overall it took me a bit of time to get familiar with JMeter, there's lots of cool things you can do with it. Keep in mind session handling (cookies) for dynamic applications as well!

Remember to read the documentation and be careful! Make sure you know what servers will be affected by your testing, and don't jump to simple conclusions, 3-tier web apps are complex beasts.

I have seen developers trying to solve a performance issue and completely misunderstanding the problem. Then they go and try and solve the wrong problem, usually involving lots of wasted coding.

Always start with a smaller load, you better off finding and fixing a bug which occurs often under low load, than an obscure bug which occurs only under extreme load.

Monday, March 03, 2008

EPSG for Australia

http://spatialreference.org/ref/epsg/3112/

http://spatialreference.org/ref/epsg/4283/

for things like PSMA & GA datasets

notice that Tassie looks better and australia isn't so wiiiide in EPSG:3112

tho, generally speaking EPSG:4283 is better choice as it's there out of the box

Oracle didn't have EPSG:3112 so i created one, EPSG:4283 is srid 4283

INSERT INTO mdsys.SDO_CS_SRS ( CS_NAME, SRID, AUTH_SRID, AUTH_NAME, WKTEXT )
VALUES ('GDA94 / Geoscience Australia Lambert', 3112, 3112, 'EPSG',
'PROJCS["GDA94 / Geoscience Australia Lambert",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4283"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",-18],PARAMETER["standard_parallel_2",-36],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",134],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3112"]]'
);
COMMIT;

Sunday, March 02, 2008

Free public transport in Melbourne? Maybe.....

Over at The Age is a story about yet another IT disaster when it comes to developing a new electronic ticketing systems for Melbourne.

Passengers face $500m ticket chaos talks about the 15 month over due 'mkyi' system still being MIA and the old MetCard system being about to fall over. They can't get any new machines for the slightly expanding network and some spare parts aren't available anymore.

Time to stop wasting money on ticketing systems and make public transport free.

It will never happen because the politicians are scared about having to spend a lot more money on expanding the transport network. The logic behind that is that if it's free, we all pay for it and therefore all suburbs deserve the equal service.

Now that would be progressive green politics, carbon friendly and just think how much closer the whole community will become from more BO on even more crowded trains...

Did you know the control system Metrol for the Met in Melbourne dates back from the 70's, it's why they can't increase the frequency of the network at least until when the new one, cough, is meant to go into service in 2010

Mapguide 2.0 Released - PNG8 Goodness

I have really enjoyed helping test on the new Mapguide 2.0.0 Release, it's a bit slower than the previous release, but that's not so much an issue if your caching everything heavy using tiled maps.

One of the new features is support for PNG8 images. You can configure the tile service to use PNG8 in the serverconfig.ini under the [TileServiceProperties] Imageformat parameter, the header comments don't mention it yet, here's my patch.

It would be nice in the future for the tile format to be configurable in the Map Definition per Base Layer Group, rather than a server wide setting.

Here is a True Marble Tile using PNG8 (36.98 kB)



The same tile as a 24 bit PNG (135.26 kB)



You can barely visually tell the difference, basically there is loss of detail of a black shadow next to the coastline, but there is 100kB difference in file size per tile.

That adds up to well over 1 MB saving per map, depending on you map size. That's 1GB over 1000 page impressions for a page containing this map. That is a huge improvement ! I will investigate later the savings for non-raster tiles

There is also the Fusion framework for doing flexible layouts which also includes the Native Mapguide Layer support for OpenLayers which rocks!