Author Topic: Heads up: Efficiency improvement in site update could be buggy  (Read 11396 times)

0 Members and 2 Guests are viewing this topic.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Today at 07:10:15 pm
Heads up: Efficiency improvement in site update could be buggy
« on: January 29, 2018, 03:45:59 pm »
Quick version: I implemented a huge efficiency improvement in the site update process today that is only barely tested so far.  I'm going to use it for tonight's site update, and it's definitely possible there will be mistakes.  Once it runs, I'll post here and people can make sure things look ok.

Longer version: As our highway data and number of lines in user list files has grown, the initial brute force matching that worked well enough when I first implemented TM has become a bottleneck in the site update process.  For last night's update, that part of the process alone ran for 22 minutes.  I've thought for quite a while that this was screaming out for a hash table, so I finally put one in today.  The trial update I ran (but did not install on site) took 17 seconds to perform that part of the update process!  Some error log messages changed slightly but I think there should be no other changes visible from the site user's perspective.  Of course, I might have broken something.  The only change is in the detection of the clinched segments on each route for each user (in other words, the whole reason people use the site), so a bug here could mean everything's a mess.  If it looks bad, I can easily enough revert to the old update code until I can debug.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Today at 07:10:15 pm
Re: Heads up: Efficiency improvement in site update could be buggy
« Reply #1 on: January 29, 2018, 10:36:00 pm »
Definitely some problems in the first attempt at a site update with the new process.  For example, I did not get credit for most of my usany travels.

I'm re-running tonight's update with the old code.  I'll make my next attempt with the new version when time permits.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Today at 07:10:15 pm
Re: Heads up: Efficiency improvement in site update could be buggy
« Reply #2 on: January 29, 2018, 11:13:20 pm »
The site update with the old code appears to have completed successfully.  Site operations should be normal.  Looks like I need to revive the test DB as a place to debug this new procedure before applying it to the production one again.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Today at 07:10:15 pm
Re: Heads up: Efficiency improvement in site update could be buggy
« Reply #3 on: January 30, 2018, 01:55:23 pm »
Found my bug quickly this afternoon and since a quick test showed stats identical to last night's, I've run a new site update right to the production site using the new process.  Spot checks of my own stats look good.  Please let me know if you notice problems.

Remaining bottlenecks in the site update process are graph generation (maybe 25-30 minutes, typically), which I am sure has many opportunities for efficiency improvements, and the ingestion of the SQL file into the DB on the server (about 6 minutes, and this is the part that results in actual downtime).

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:November 20, 2024, 11:21:09 am
Re: Heads up: Efficiency improvement in site update could be buggy
« Reply #4 on: January 30, 2018, 03:32:31 pm »
I made screen shots yesterday and my stats seem to be exactly the same today. Good job!

Offline mapcat

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1767
  • Last Login:Today at 09:41:19 am
Re: Heads up: Efficiency improvement in site update could be buggy
« Reply #5 on: January 30, 2018, 09:17:59 pm »
I made screen shots yesterday and my stats seem to be exactly the same today. Good job!
Same here.
Clinched: