Monday, September 29, 2008

Yahoo's home page not optimized for performance.

Well, that's not my verdict. It is the report card given by, err, Yahoo. See here.



Friday, September 26, 2008

S3. Should you use subdomain or directory for bucket?

When you create a bucket on S3 to host media content for public access there are two ways you can create the URL.

http://bucket-name.s3.amazonaws.com/

Or

http://s3.amazonaws.com/bucket-name/

Sometimes people name their buckets with their domain name, which just looks good. Otherwise it is same as first or second one.

Here is my unscientific observation done via wget. The method of using sub-domain is slower.

Here is why.

If bucket-name.s3.amazonaws.com domain is not extremely popular, name resolution takes some time. The subdomain s3.amazonaws.com is few orders of magnitude (think thousands of times) popular than the ones with bucketname prefixed to it, domain resolution happens very quickly.

Of course, once that domain is found, the subsequent requests should be faster with DNS caching. But this problem will again arise when the DNS is flushed.

Tell me how wrong I am on this.

Labels: ,


Wednesday, September 24, 2008

JSP page buffer size fix for slow page generation/loading

If you think, a JSP page is taking lot of time to load, here is one of the possible reason. The default buffer size for the jsp page is 32k. When this buffer gets full, the buffer is pushed on the net. Sometimes it might be desirable to flush buffers as it doesn't leave user wondering what's happening. But what if you were just close to complete the page? This is what happened with us.

<%@page buffer="64kb" %>

When we pushed up the buffer size, a delay of around 800 ms just vanished.

Labels:


Wednesday, September 03, 2008

Mysql dump with blob

While working with Mysql database with blob, we encountered a problem. The database was populated from a source, then mysqldump was used to create dump file, which was imported on another machine. The java code to read this database suddenly started failing with following exception.

Could not convert byte array to object
java.io.StreamCorruptedException: invalid stream header


The problem was with blob we were storing in the db. After adding "--hex-blob" option, mysqldump created a clean dump which worked smoothly.

Asides. As a general practice I put the error message as google search query to get the solution quickly. In this case, it backfired as I was sent on a wild goose chase in java jungle.

Labels: ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]