speeding things up

Topics: Developer Forum, User Forum
Sep 6, 2011 at 6:41 PM

Hi Cheeso

I've got a site working using your excellent product but it's running slow, especially when first called. I'm guessing the first run is cacheing but subsequent requests aren't as quick as I'd hoped. Here's my configuration:

Site is on IIS6, ASP.Net v2 and cacheing is on (in the IIS website properties)

It's running in it's own application pool nothing else in it.

I have set worker process to recylce after 6 hrs being idle rather than 20 minutes default (it's a new site so not getting many hits just yet).

there are 2 mapfiles. One has 45,000 entries, the other about 2,000

You can see the speed issue at www.hit the bar.co.uk (please note I've added spaces as I don't want it spidering yet!)  and select BROWSE. Assuming no-one has request that page recently then it might take a few seconds (6-7)

If that is quick then select a letter from the A-Z like B,S or T and that might still be slow (3-4 seconds)

The ini looks like this:

RewriteEngine on
StatusInquiry ON
RewriteLogLevel 0
RewriteLog ************************** <- removed for security reasons!
RewriteMap mapfile txt:*****************mapfile.txt
RewriteMap mapfilebrowse *************************mapfilebrowse.txt
RewriteCond  ${mapfilebrowse:$1|NotFound}  !NotFound
RewriteRule ^/([^/\.]*)$ /browse-search.asp?${mapfilebrowse:$1} [L]
RewriteCond  ${mapfile:$1|NotFound}  !NotFound
RewriteRule ^/([^/\.]*)$ /detail.asp?pubid=${mapfile:$1} [L]

Is there any benefit of the mapfiles being in alphabetical order?

Thanks in advance....


Sep 7, 2011 at 4:48 AM

45000 entries, I think you have the record.

No, there's no benefit to the mapfile being in alpha order.  The lookup is naive - it simply scans through the list and picks the first match. It would benefit you to put the most commonly matched items nearer the front of the list. But the "returns" diminish pretty rapidly.

I think the appropriate thing in this case is for me to modify IIRF to implement a hashtable lookup - it will perform significantly better regardless of the order of the entries in the map file. 

Sep 7, 2011 at 5:12 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 7, 2011 at 4:22 PM

ok I updated that workitem with a test build. Try it, it may speed things up for RewriteMaps that are very large.  It won't hurt for RewriteMaps that are small.