10 ms·
How Stack Overflow upgraded from Windows Server 2012
- dvdbloc 7y agoAnyone know why systems like this aren’t Linux based? Seems rather ironic when stack overflow seems to be a staple of the open source/sharing community.
- romanovcode 7y agoThey started with .NET MVC + SQL Server which was not running on Linux back then.
- timrichard 7y agoIIRC from previous articles, HAProxy and Redis are key components too.
- p_l 7y agorunning on linux servers, too. (as well as the ELK stack, which handles logging)
- stevoski 7y agoIIRC when Joel Spolsky and Jeff Atwood started Stack Overflow, they both had strong expertise in the Microsoft ecosystem. So they used the skills and knowledge they already had. It was quite the coup at the time for Microsoft, especially the SQL Server team, to have such a high profile, high-traffic site.
- goatinaboat 7y agoSpolsky is former MS and familiar with their stack. Additionally, SQL Server is a very good database, fast, reliable and feature-rich. Additionally part 2: Microsoft owns Github, can’t get more open source than that!
- dspillett 7y agoMS owning GitHub is a very recent thing in GitHub's development, so that isn't really a good comparison. I doubt getting bought by MS was anything like the plan in the early days! > Spolsky is former MS and familiar with their stack That is key: often experience (i.e. the cost of problems caused by lack of experience) can outweigh licensing considerations, particularly in the fast moving PoC/prototype stages and the subsequent quick growth phase. > Additionally, SQL Server is a very good database No argument there. While other DBs could certainly do the job too, SQL server is a good choice, even without that "experience bonus".
- alkonaut 7y agoYou couldn’t run .NET on Linux (well) back then, and they wanted to implement it using .NET. License costs wouldn’t be a good reason to pick another stack over the one you know.
- Benjamin_Dobell 7y agoMono supported ASP really well as far back as 10 years ago. Stack Overflow launched 11 years ago, and I didn't try it then, so perhaps they just missed out? Although, tooling was very heavily Windows based at the time (no Rider); so it is understandable why StackOverflow took the direction they took.
- tpolzer 7y agoHave you actually used old Mono? I remember sluggish performance, especially of its stop the world garbage collection.
- rwbaskette 7y agoAlso, the standard library for ASP.NET either had gaps or somewhat incompatible implementations of features. I’d give time to attempt a port of a mid-size web forms app every couple years but ran into a number of issues each time. It was an amazing achievement, but never quite got me there.
- merb 7y agono. Maybe ASP MVC4+ worked well with Mono, but WebForms and MVC below 4 was/is just horrible.
- romanovcode 7y agoMono had crap performance on .NET MVC and also some things just did not work. Mono would be horrible, horrible choice for website like SO. Source: Was runnin .NET on Mono 7 years ago or so.
- Benjamin_Dobell 7y ago
- madiathomas 7y agoNothing ironic here. Stackoverflow wasn't designed for open source software. It is a Q and A system for all Developers. People who develop in proprietary technologies also need help when developing. They also share code. A lot. Not sure what gave you an impressiopn that SO is a Linux community because it is not.
- p_l 7y agoThey consider the Windows + .NET stack to have saved them more money than they pay in licensing et al. At the time, major "web development" stacks that people would have thought of on Linux tended to be much more resource hungry (still are), meanwhile the people behind StackOverflow had very good .NET skills that they could apply immediately. This translated into being able to serve more people per server than if they used, let's say, PHP, Ruby, Python, etc. And as people said, SQL Server. Which is a very, very capable database server with impressive performance.
- trilila 7y agoI am not sure what your statement is based on regarding linux being more resource hungry than windows. Have stats to back this up? Same for goes for the SQL Server’s “impressive performance”.
- GonzaloQuero 7y agoThe stacks, not the system. At the time StackOverflow was built, the main Linux stacks were either PHP, Rails, Django, or similar, which, while good, are not as performant.
- trilila 7y agoI am puzzled, what are these statements based on? "Linux stacks were either PHP, Rails, Django, or similar, which, while good, are not as performant." - first time I hear a .NET/Windows/SQL Server stack is more performant than these.
- nikanj 7y agoThe performance of PHP was a joke when Stack Overflow started. It has gotten way better since, but back then it was reading, parsing and compiling every single script your page loaded, for every single page load. You could hack around this with an accelerator module like APC or Zend, but why bother learning how to code around PHPs limitations, when you're already fluent in C# that's plenty fast without any hacking. Not sure how the story goes for Rails, but Python (Django) used to be a pig when SO was started over a decade ago, for similar reasons as PHP.
- lubos 7y agoFrom Atwood/Spolsky podcasts it seems like Spolsky had zero impact on tech stack. Jeff Atwood was at the time C# programmer so he wrote StackOverflow in C#. More context: https://blog.codinghorror.com/why-ruby/ https://blog.codinghorror.com/why-ruby/
- jimmcslim 7y agoI wonder if they would make the same decision about Discourse and Ruby today, given that .NET Core is now a thing and open-source?
- romanovcode 7y agoI bet not, it was clearly a hype-decision for Discourse.
- JeremyBanks 7y agoIt was because his cofounder, who was doing more of the initial coding, was most comfortable with Ruby.
- danielovichdk 7y agoWhy should it be? Honest question.
- madiathomas 7y agoThat was my first reaction when I saw this comment. Why should everything be in Linux? Also considering that SO does the job and does it very well.
- callesgg 7y agoCause it is more work to manage windows servers than it is to manage Linux servers. Less work is better than more work so Linux is better for server implementations. But I guess that is something people will argue over for a long long time. Well... my opinion, based on my experience...
- viraptor 7y agoIf you have people experienced in managing Windows, but not Linux, then it's less work to manage Windows servers.
- callesgg 7y agoYou can learn how to manage Linux and then get even less work. Anyway... I was certainly not saying that there are not scenarios where it is better to go with windows servers. Things don't happen in a vacuum.
- joelhaasnoot 7y agoIt would be interesting to see if they could move their hosting to Linux with something like Mono, even if just testing and seeing what the performance difference is for web nodes. I guess those are rarely the actual bottleneck, but still.
- ocoster 7y agoThey are in the process of migrating to .NET core, which runs on Linux. Wether they choose to move to linux is a different matter.
- zen_mike_eu 7y agoIt would be interesting to get a guesstimate for the licensing costs of all this.
- jeswin 7y agoI wouldn't be surprised if the software is very heavily discounted, given that it's a very high-visibility public website frequented by people who make technical decisions.
- pjc50 7y agoThe number of production nodes appears to be small - less than 10?
- nikanj 7y agoAround a dozen servers at https://stackexchange.com/performance https://stackexchange.com/performance . Around $1k for Windows per machine, around $5k per SQL * 4 servers. All in all, well under $50k in licensing costs. Basically a rounding error, if you compare to something like AWS billing for a website of the same scale.
- BrentOzar 7y ago> around $5k per SQL * 4 servers. I wish. Microsoft SQL Server Enterprise Edition (which is required if you want to use over 128GB RAM for caching data, or servers with over 24 cores) costs approx $7,000 per CPU core.
- nikanj 7y agoYikes! For contrast, Buffer burns through $20k per month in managed hosting ( https://open.buffer.com/transparent-pricing-buffer/ https://open.buffer.com/transparent-pricing-buffer/ ). Running a site at scale is an expensive ordeal
- romanovcode 7y agoWhat does this SAAS has anything to do with MS server pricing
- raverbashing 7y agoWhenever I read something like this (and I'm not blaming MS here, most tools are like this) it seems that configuration and setup of systems is still in the chipped stone age... No services (or versions of services) talk smoothly with each other, setup is very prone to mistakes and it's just a big pain overall. (Windows probably makes it a bit hard though)
- acqq 7y agoThe full text is here: https://www.tarynpivots.com/post/how-stack-overflow-upgraded-from-windows-2012/ https://www.tarynpivots.com/post/how-stack-overflow-upgraded...
- trilila 7y agoPersonally, I am not a huge fan of Windows, .NET and SQL Server, but this is a good example of a company using the right tool for the task at hand, rather than copy pasting popular stacks. It would be really interesting to see some stats, benchmarks, or any interesting metrics to help understand the benefits or drawbacks of using this tooling. There is way too much focus on Linux, to the point where I am worrying that Linux itself is becoming a monopoly, and it might end up not benefiting from good competition.
- fabian2k 7y agoThere is a high-level overview of the Stack Exchange servers at https://stackexchange.com/performance https://stackexchange.com/performance More details are scattered across various places, e.g. Nick Craver's blog (https://nickcraver.com/blog/ https://nickcraver.com/blog/) and the Stack Overflow and Stack Exchange meta sites.
- trilila 7y agoNice one, thanks for this.
- mattmanser 7y agoI've got some clients on dedicated servers and some on cloud, the performance differences are staggering. Cloud seems so bad. For what you pay for in cloud it really feels like you get 10x the performance for the same price in dedicated hosting. This really underlines it. Running one of the most popular sites on the web with just 9 web servers, 2 SQL servers and a smattering of dedicated role servers. But that popularity ultimately boils down to 450 req/s, and they've got a nice, fast site. No faffing around with "scaling" up and down to handle the fact the cloud servers are slow. It always feels you get nowhere near the listed performance and are constantly getting throttled. I would guess a lot of startups would be better off paying a few grand a year for a couple of dedicated servers and just forgetting about AWS/Google Cloud/Azure.
- BrentOzar 7y ago> But that popularity ultimately boils down to 450 req/s Way higher than that. Was 2X higher back in 2016, even: https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...
- plq 7y agoI will be honest and just say this: As a Linux guy who has negligible familiarity with the Windows Server technology, this post doesn't make much sense to me. What is the Linux equivalent of this operation? apt-get dist-upgrade? Now that Windows 10 onward is rolling release (is it?) is this the last time SE staff is going to have to go through this? This caught my attention: > Putting the 2019 server into the existing 2012 cluster – as expected, this fails due to the operating systems being different. How can a website be this tightly coupled with the operating system it's running on? Shouldn't Microsoft be blamed that their operating systems are not backwards-compatible? To my knowledge, Microsoft goes to extreme lengths to assure backwards-compatibility of the userland apps. What went wrong here?
- madiathomas 7y agoWindows 10 was designed for desktops, not as a server software. Windows Server 2003/2008/2012/2014/2019 etc is for servers and they don't subscribe to Windows 10 rolling release. They have their release and support cycles. People rarely upgrade. I have upgraded a website from Windows 2003, to Windows 2008, to Windows 2012 and now it is running on Windows 2019. I jumped 2014 and 2016 because upgrades weren't necessary for my needs. Each time, I only spent 1 hour maximum to migrate the system. I am not even a server guy.
- amaccuish 7y agoYou mean 2016 right, not 2014? Or are you talking about SQL versions?
- madiathomas 7y agoYes. I meant Windows Server 2016. Thanks for the correction.
- deleted 7y ago[deleted]
- linsomniac 7y agoThe Linux equivalent would be upgrading a database cluster from CentOS 5 to 7, or Ubuntu 12.04 to 18.04. On a production cluster, you aren't just going to "apt dist-upgrade" and be done, you're going to need to deal with versions of all sorts of things under the hood changing versions as well. In the SO case, they were at least able to keep the database versions the same, but it sounds like some other things were incompatible between the two OSes that prevented them from directly clustering together.
- number6 7y agoBest part is the second part, where they stop upgrading to 2019 cause it destroys their SSDs: https://www.tarynpivots.com/post/how-stack-overflow-upgraded-from-windows-2012/#phase-2-the-part-where-i-broke-dev https://www.tarynpivots.com/post/how-stack-overflow-upgraded...
- thefarseeker 7y agoI'm Taryn's coworker I was involved in that part of the process very closely. That statement is not entirely accurate. The SSDs certainly did die, but not _because_ of the 2019 upgrade, it just happened at the same time as the 2019 upgrades. The major 2019 SSD issue was however that Intel and Dell kept passing the buck on who was to blame for not having 2019 drivers for the NVMe SSDs. Eventually I ended up having to bully Intel into giving us the drivers. We decided that "bullying Intel" was not an appropriate future tactic for getting the next version of the drivers, so that's another factor for staying on 2016 (which has drivers we've tested for years)
- znpy 7y agoInteresting, how does one bully Intel? I wanna bully Intel too (/s)
- dmhimanshu 7y agonice one
- EnderMB 7y agoI'm surprised by all the negative comments here surrounding how Windows Server or SQL Server makes this more complicated, or whether the license costs are prohibitive. I worked as a .NET dev for nine years, and although I've never had to deal with upgrades at this level before, I can appreciate that at the kind of scale that Stack Overflow operate, and considering they run on physical boxes (a rarity in any stack nowadays) any kind of upgrade between major database and OS versions is going to result in its own issues. While I don't work on the Microsoft stack any more, I've always appreciated the way that Stack Overflow build their software. Their engineers and DBA's seem to be a who's who of talent, and they both build great services and put out great content, at scale. It's doubly-surprising when so many people used to give Jeff Atwood so much shit for not delivering anything of note when Coding Horror was one of the top programming blogs on the web. The stack might be very different to anything done in 2019, but the fact that I can't think of many times where Stack Overflow went down shows that they're doing a great job, and hopefully they'll continue to document the journey for years to come.
- Accacin 7y agoI'm a big Linux fan, and use it as my daily driver but I can't understand why so many people are talking about Linux when it's been very clearly explained why the chose an MS stack. They had already got experience with it! That's why they chose it. In my opinion go with the stack you have experience with, don't just do what everyone else is doing.
- eternalny1 7y agoI like how Stack Overflow, in a market that is ripe to bash everything and anything, has no qualms about discussing running .Net and SQL Server. I've been a software engineer for over two decades now and I've seen stuff come and go. The products Microsoft is shipping today are impressive bits of technology and, and the end of the day, do what you want them to do and do that very well. And I've been through the more difficult years where I wish I had thrown SQL Server off a cliff. Why am I bothering to write this? Because I'm still in technology and I wish people would stop jumping on the next bandwagon or pointing to the next shiny object. There are tried-and-true technologies out there that shouldn't be ignored based on prejudices. Stack Overflow is a great example of a company who understands this.