[thelist] ASP Equivalent for CreateUUID() ?

Chris Evans chris at fuseware.com
Tue Apr 3 21:47:55 CDT 2001


We originally created the algorithm for a major e-commerce site due to
slowness when using CreateUUID(). I don't remember the exact algorithm UUID
uses ( its been about 6-9 months since we did our testing) but I believe it
makes a call to get the NIC MAC address, and uses a MD5 hashing algorithm to
create the UUID.  Using the CF function was taking around 100 ms per ID, my
algorithm was taking 5-10 ms.  I'm not sure why CF was taking so long, but I
do remember Allaire said that was standard and expected.  This was on 4.5
Solaris - different versions/ platforms could vary.

AS far as stress testing goes, we ran a 6 hour stress test simulating a
couple of hundred simultaneous users, enough to move the CF processes up to
50 requests with some starting to queue.  This was done using LoadRunner
testing software.  When we were satisfied with the results, we moved it into
the production environment, and logged the IDs as they were created.  After
four days, we had over a million created, and no dupes and no noticeable
impact on the server.

I do think we used a slightly modified algorithm - appending GetTickCount()
on the time to account for milliseconds, and using a server key to account
for the machines in the cluster.  We also had a traffic analysis /
personalization company do a report on our UID strategy, since it was
designed as part of the e-commerce's personalization initiative.  The
outside vendor signed off on our algorithm.

There are two keys to the algorithm.  First, the same IP address hitting
within the same millisecond and hitting the same 5 digit random number makes
duplication highly unlikely.  Secondly, the algorithm is quick and easy to
replicate across any language you are likely to encounter on the web.

Hope that answers your questions,


Chris Evans
chris at fuseware.com
http://www.fuseware.com








More information about the thelist mailing list