Friday, June 6, 2014

Deploying my new web site: One step forward, six seconds back.

I finished setting up an Industrial-Strength Django website on my current favorite hosting site, Digital Ocean, and said what the heck, let's go ahead and make it the real aufrecht.org.  Since my blog (that you are reading right now) is actually just Google Blogger, hosted at blog.aufrecht.org, and my email is Gmail, the only thing on aufrecht.org is a static home page placeholder:


So I edited the home page of the new Django-CMS site, and aside from the detail that I couldn't get Kona's pictured centered even though I clicked Center in the CMS, and the detail that in order to change the "djangocms" logotype to "aufrecht.org" I had to learn what a png sprite was (Its existence is driven by the same detail that affects grocery store line optimization: the overhead of downloading a new file to a web browser is like the overhead of somebody fumbling for their checkbook right at the end, not only having not bothered to bag their own damned groceries but having chosen to spend that entire time staring into space with a faint smirk rather than digging out their checkbook.  Three people with three items each take much more time than one person with nine items, provided the checker isn't an arthritic person forced into post-retirement manual labor by the insatiable greed of the 0.01%.  Taking the parallel back to web development, obviously you are better off with one big graphic file than fifty tiny ones, because the Walton family's tax-dodging fake charities make your network slow.) and then I had to force myself to just manually edit the sprite in a temporary hack that will disappear as soon as I regenerate static content rather than spend 2 more hours learning the best and most Pythonic way to override Django's defaults—a css shim, editing the original package, a hack in Ruby?, but after that, my new Digital Ocean server, temporarily set up as pre.aufrecht.org (with separate database server) was ready to become aufrecht.org. 


So I went to my DNS provider to make the switch but I couldn't remember which company is hosting the current static page and I tried to check and discovered that, somehow, between with 1and1's confusing interface and my shaky command of the exact details of DNS lingo, I apparently already made the switch yesterday.  I guess that when I tried to set the IP address for pre.aufrecht.org to the server, and I set the "IP Address" and not the "CNAME" (can you set a CNAME to an IP?  In keeping with the general obstinacy of this project, I'm not even going to look that up right now, but I am going to create this link which I will click on later), and instead of setting pre.aufrecht.org, that changed the whole aufrecht.org IP to point to my new site.  So, setting up a new Digital Ocean server pair from scratch using my new instructions took 4.3 hours, and making that site be aufrecht.org took either 55 minutes or negative one day, depending on how you count, so I may have come out ahead by about 19 hours in this whole thing.  I'm still not sure exactly what happened with the CNAME IP thing, and did it mean that for most of a day aufrecht.org was coming back with an nginx proxy error, and who was actually hosting the previous aufrecht.org anyway, and do I still owe them money ... but this captures my feelings:
But if Future Wolverine from the original Dark Future wakes up in the head of Future Wolverine from the Bright Future, doesn’t that mean that there is a separate Wolverine Consciousness who suddenly gets wiped out of existence when the Original Wolverine Consciousness comes back to the Bright Future?
Well-
But if in the original timeline Mystique was captured by Trask’s people, why didn’t she spend the original trilogy trying to get back at the people who experimented on her?
I mean, there could be an explana-
And in the original timeline, how did Magneto ...
Anyway.  Everything on aufrecht.org looks almost the same as it did before, but instead of a simple HTML page and image and web server, there is now an entire Enterprise-grade infrastructure of nginx, supervisor running gunicorn, django-cms, memcached, and a host-separated, ssl- and private-network-secured PostgreSQL server providing the same thing.  And Kona is now left justified.  And the page takes seven seconds to load.  What?

Webpagetest says 6.858 seconds on first view, .5 seconds on repeat.


Gtmetrix says 6.94 seconds.


Pingdom can do it in 6.18 seconds


And in all cases, the web page itself is pretty fast, milliseconds, but somehow the page request sits for six seconds before it even hits the webserver, as verified by watching the logs while browsing the site.  It's true that I picked Digital Ocean's Amsterdam server farm out of a vague and not-really-thought-out protest of the NSA's illegal and anti-democratic domestic spying program, but even if the servers are all smoking pot it shouldn't take six seconds.

In a waterfall process I might say that was a bug and spend all weekend trying to figure it out.  But in my Agile process, where I'm both the Team Member and the Product Owner, I am declaring 6 seconds acceptable for the original task of setting up aufrecht.org, and getting that down to under a second is going to be a new task, to be done later.  Maybe by Kona, who in the year or two since the temporary page was created has not found any new snoozing positions:




No comments :

Post a Comment