Show Menu
TOPICS×

The 'playlog' utility

The playlog utility can be used to pre-generate contents for the HTTP response cache.
The existing Image Serving HTTP response cache is not guaranteed usable after a major version upgrade (when the first or second digit of the version number changed). If the server is to be taken live into full-load conditions after the upgrade, the server may be overloaded handing the first few hours of cache miss requests until the cache is reasonably populated and the cache hit rate increases.
To avoid this initial load spike, the playlog utility can be used to pre-generate contents for the HTTP response cache. playlog extracts HTTP requests from an existing access log file and sends it to the server to generate cache entries. For typical usage scenarios, it is sufficient to play back a single access log file containing a full-day's worth of traffic.
In addition to priming the HTTP response cache after upgrade installs, the utility is also used to pre-generate cache contents when adding a new server to a load-balanced environment; simply play back a recent log file from one of the other servers.
playlog can be configured to support most access log files generated by prior versions of Image Serving.

Usage

playlog *[logFile]* [-n *[col]*] [-s *[separator]*] [-m *[marker]*] [-p *[prefix]*] [-x *[suffix]*] [-v] [-h] [-r *[request method]*] [-o *[position]*]
-p prefix
Root URL to prepend to the requests extracted from the log file.
Default: http://localhost:8080/is )
-n col
Field (column) number which contains the request in the log record; 1-based.
Default: 16
-s separator
Field separator; regular expression pattern.
Default: [ ]+ )
-m marker
Request marker; identifies requests in the log file which should be played back; regular expression pattern.
Default: Request: )
-x suffix
Suffix to append to the request extracted from the log file; can be used to separate played-back requests from live requests in the log files; a '?' or '&' separator is inserted automatically; suffix can reference any log field by position within curly braces, default corresponds to md5 signature field.
Default: playlog={25} )
-v
Verbose mode, prints the generated request URLs to stdout .
-h
Print a synopsis to stdout .
-r
request-method - HTTP request method to use ( get|post|head|smart ).
Default: smart )
-o
request-method-pos - pos in log file to grab original method from.
Default: 15
For Windows, the filename is playlog.bat and on Linux it is playlog.sh.

Examples

The following example plays back all requests from an access log file created by Image Serving on Linux:
> cd /usr/local/Scene7/ImageServing/logs
> ../bin/playlog.sh access-2007-01-01.log -n 18 -s ' ' -m . -p http://localhost:8080
The following command plays back all requests found in a trace log file created by Image Serving on Windows:
> "\Program Files\Scene7\ImageServing\bin\playlog.bat" d:\logs/access-2006-09-01.log