ݺߣ

ݺߣShare a Scribd company logo
Wringing Performance out of Perl
Wringing Performance out of Perl
Grant Street GroupBegan as a financial advisor group
Grant Street GroupDiscovered the Internet in 1997
Grant Street GroupOnline Auctions of Property Tax LiensWeb-Based billing system for tax collectorsConversion of legacy tax-collector databasesOnline license / vehicle tag renewalsOnline payment processingAuctions of all types of bondsAnd lots, lots more!
Tax Lien Auctions
Tax Lien AuctionsAbsolute feeding frenzyOur bidders threatened to exhaust TIN numbers20 million bidders in 2011More than 30 billion bids altogetherAverage was a 500,000-way tieAbout 2,000 auctions closing simultaneously
Tax Lien AuctionsHow do we award auctions performantly?Random tie-breaking with Crypt::RandomRandom row-ID plus MySQL = S L O WTurns out we can do it much faster in Perl
Tax Lien AuctionsNet result: auction closing takes 20 secondsBreaking 2,000 ties, each 500,000-wayStress-testing indicates can scale by 4xThe IRS definitely cannot scale by 4x
Property Tax Online Payments
Property Tax Online PaymentsFlorida residents can pay the property taxHosted, customized sites per countyLargest counties have ~1,000,000 parcelsUsers are typical Florida residents
Property Tax Online Payments
Property Tax Online Payments
Property Tax Online Payments
Property Tax Online Payments
Wringing Performance out of Perl
Property Tax Online PaymentsBackend is MySQL and SphinxLightning-fast searches with PerlMapping IDs to table, column, PKParsing SHOW STATUS LIKE sphinx%Lots of useful metadata!
Property Tax Online PaymentsNet results:Sub-second turnaround times9 minute average time on site by payers4 minute average time on site overall
Customer Data Conversion
Customer Data ConversionLargest county in FL is a customerPopulation ~2.4M peopleTax roll of ~900K parcelsHistory of ~5.6M bills across 6 yearsFull database is large (by our standards)Data files are ~30-50GBFull conversion is ~160 hours, using PerlMight be ~8 hours using pure SQL
Customer Data ConversionProblem is we cant use pure SQLRidiculous amounts of business logicUtterly different data modelsWere a Perl shop; Perl is our hammer
Customer Data ConversionHugely parallel data conversionSubdivide conversion into smaller stepsBuild hash of dependencies between stepsConstruct DAG of work units in MongoDBDistribute the actual workRun lots of Perl worker processesWorkers grab ready work unitsPerform the work unit sequentially
Customer Data ConversionThe end resultTotal conversion time ~3 hours with 80 workersNightly reloads now very practicalAble to resume incomplete loads
Were Hiring Telecommuters

More Related Content

Wringing Performance out of Perl

  • 3. Grant Street GroupBegan as a financial advisor group
  • 4. Grant Street GroupDiscovered the Internet in 1997
  • 5. Grant Street GroupOnline Auctions of Property Tax LiensWeb-Based billing system for tax collectorsConversion of legacy tax-collector databasesOnline license / vehicle tag renewalsOnline payment processingAuctions of all types of bondsAnd lots, lots more!
  • 7. Tax Lien AuctionsAbsolute feeding frenzyOur bidders threatened to exhaust TIN numbers20 million bidders in 2011More than 30 billion bids altogetherAverage was a 500,000-way tieAbout 2,000 auctions closing simultaneously
  • 8. Tax Lien AuctionsHow do we award auctions performantly?Random tie-breaking with Crypt::RandomRandom row-ID plus MySQL = S L O WTurns out we can do it much faster in Perl
  • 9. Tax Lien AuctionsNet result: auction closing takes 20 secondsBreaking 2,000 ties, each 500,000-wayStress-testing indicates can scale by 4xThe IRS definitely cannot scale by 4x
  • 11. Property Tax Online PaymentsFlorida residents can pay the property taxHosted, customized sites per countyLargest counties have ~1,000,000 parcelsUsers are typical Florida residents
  • 17. Property Tax Online PaymentsBackend is MySQL and SphinxLightning-fast searches with PerlMapping IDs to table, column, PKParsing SHOW STATUS LIKE sphinx%Lots of useful metadata!
  • 18. Property Tax Online PaymentsNet results:Sub-second turnaround times9 minute average time on site by payers4 minute average time on site overall
  • 20. Customer Data ConversionLargest county in FL is a customerPopulation ~2.4M peopleTax roll of ~900K parcelsHistory of ~5.6M bills across 6 yearsFull database is large (by our standards)Data files are ~30-50GBFull conversion is ~160 hours, using PerlMight be ~8 hours using pure SQL
  • 21. Customer Data ConversionProblem is we cant use pure SQLRidiculous amounts of business logicUtterly different data modelsWere a Perl shop; Perl is our hammer
  • 22. Customer Data ConversionHugely parallel data conversionSubdivide conversion into smaller stepsBuild hash of dependencies between stepsConstruct DAG of work units in MongoDBDistribute the actual workRun lots of Perl worker processesWorkers grab ready work unitsPerform the work unit sequentially
  • 23. Customer Data ConversionThe end resultTotal conversion time ~3 hours with 80 workersNightly reloads now very practicalAble to resume incomplete loads