Squid3.0, ICAP server in python and respmod

From: Jeremy Lardon <jeremy.lardon@dont-contact.us>
Date: Tue, 03 Apr 2007 16:25:09 +0200

Hey all,

After some tests, I made my mind for squid3.0 and python based ICAP server.
All works fine with reqmod precache but I cant' manage to get a response
modification.

On the side of the ICAP server, log messages display normally but on the
squid side no error is raised and the browser displays nothing (the
response body seems empty).

Note : I got a parent cache.
First of all my squidbox (and my ICAP server) is a debian etch with a
version 2.6.8-2-386 linux core.

Here is the squid.conf part about ICAP :
icap_enable on
icap_service s1 respmod_precache 0 icap://<icap server IP>:1344/respmod
icap_class c1 s1
acl images urlpath_regex \.jpg$
acl images urlpath_regex \.png$
acl images urlpath_regex \.gif$
acl images urlpath_regex \.ico$
icap_access c1 deny images
acl css urlpath_regex \.css$
icap_access c1 deny css
acl HTTP proto HTTP
acl GET method GET
icap_access c1 allow HTTP GET

access.log :
1175608936.978 117 <squidbox IP> TCP_MISS/200 593 GET
http://www.lemonde.fr/rss/sequence/0,2-3208,1-0,0.xml -
DEFAULT_PARENT/<parent cache address> text/html
1175608938.340 43 <squidbox IP> TCP_MISS/200 522 GET
http://linuxfr.org/backend/news/rss20.rss - DEFAULT_PARENT/<parent cache
address> text/html

cache.log :
2007/04/03 16:01:47| Starting Squid Cache version 3.0.PRE5-20070330 for
i686-pc-linux-gnu...
2007/04/03 16:01:47| Process ID 14008
2007/04/03 16:01:47| With 1024 file descriptors available
2007/04/03 16:01:47| Performing DNS Tests...
2007/04/03 16:01:47| Successful DNS name lookup tests...
2007/04/03 16:01:47| DNS Socket created at 0.0.0.0, port 38546, FD 4
2007/04/03 16:01:47| Adding domain univ-st-etienne.fr from /etc/resolv.conf
2007/04/03 16:01:47| Adding nameserver <dns server 1 address> from
/etc/resolv.conf
2007/04/03 16:01:47| Adding nameserver <dns server 2 address> from
/etc/resolv.conf
2007/04/03 16:01:48| Unlinkd pipe opened on FD 9
2007/04/03 16:01:48| Swap maxSize 102400 KB, estimated 7876 objects
2007/04/03 16:01:48| Target number of buckets: 393
2007/04/03 16:01:48| Using 8192 Store buckets
2007/04/03 16:01:48| Max Mem size: 8192 KB
2007/04/03 16:01:48| Max Swap size: 102400 KB
2007/04/03 16:01:48| Rebuilding storage in
/home/adminlardon/squid/var/cache (CLEAN)
2007/04/03 16:01:48| Using Least Load store dir selection
2007/04/03 16:01:48| Set Current Directory to
/home/adminlardon/squid/var/cache
2007/04/03 16:01:48| Loaded Icons.
2007/04/03 16:01:48| Accepting HTTP connections at 0.0.0.0, port 3128,
FD 11.
2007/04/03 16:01:48| Accepting ICP messages at 0.0.0.0, port 3130, FD 12.
2007/04/03 16:01:48| WCCP Disabled.
2007/04/03 16:01:48| Ready to serve requests.
2007/04/03 16:01:48| Configuring Parent <parent cache address>/3128/3130
2007/04/03 16:01:48| Done reading /home/adminlardon/squid/var/cache
swaplog (184 entries)
2007/04/03 16:01:48| Finished rebuilding storage from disk.
2007/04/03 16:01:48| 184 Entries scanned
2007/04/03 16:01:48| 0 Invalid entries.
2007/04/03 16:01:48| 0 With invalid flags.
2007/04/03 16:01:48| 184 Objects loaded.
2007/04/03 16:01:48| 0 Objects expired.
2007/04/03 16:01:48| 0 Objects cancelled.
2007/04/03 16:01:48| 0 Duplicate URLs purged.
2007/04/03 16:01:48| 0 Swapfile clashes avoided.
2007/04/03 16:01:48| Took 0.1 seconds (3231.2 objects/sec).
2007/04/03 16:01:48| Beginning Validation Procedure
2007/04/03 16:01:48| Completed Validation Procedure
2007/04/03 16:01:48| Validated 393 Entries
2007/04/03 16:01:48| store_swap_size = 1052
2007/04/03 16:01:49| storeLateRelease: released 0 objects
2007/04/03 16:01:59| <ICAP server address>'s clock is skewed by 3600
seconds!
2007/04/03 16:02:34| Preparing for shutdown after 7 requests
2007/04/03 16:02:34| Waiting 0 seconds for active connections to finish
2007/04/03 16:02:34| FD 11 Closing HTTP connection
2007/04/03 16:02:35| Shutting down...
2007/04/03 16:02:35| FD 12 Closing ICP connection
2007/04/03 16:02:35| Closing unlinkd pipe on FD 9
2007/04/03 16:02:35| storeDirWriteCleanLogs: Starting...
2007/04/03 16:02:35| Finished. Wrote 184 entries.
2007/04/03 16:02:35| Took 0.0 seconds (260992.9 entries/sec).
CPU Usage: 1.099 seconds = 0.141 user + 0.958 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        total space in arena: 3556 KB
        Ordinary blocks: 3407 KB 9 blks
        Small blocks: 0 KB 6 blks
        Holding blocks: 3464 KB 16 blks
        Free Small blocks: 0 KB
        Free Ordinary blocks: 148 KB
        Total in use: 6871 KB 193%
        Total free: 148 KB 4%
2007/04/03 16:02:35| Squid Cache (Version 3.0.PRE5-20070330): Exiting
normally.

Final note : all works perfectly without icap transformation.

All help will be greatly appreciated.

Jérémy Lardon
Received on Tue Apr 03 2007 - 08:56:59 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Apr 29 2007 - 12:00:03 MDT