Live data from Hacker News

StackOverflow Update: 560M Pageviews a Month, 25 Servers

highscalability.com

81–90 of 278 posts

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#81
post #77

Earlier quoted context omitted.

Sometimes "efficient" and "easy to understand and be sure is correct" don't have to be mutually exclusive; see this example [1] of Java and Go. Note that the code is autogenerated, so it should be equally efficient. The Go version also happens to be very simple and no different than most humans would write by hand (without trying very hard to optimize). [1] https://gist.github.com/shurcooL/9f94bbd021b4693cf584

I'm not disputing that efficient code can be easier to understand in some instances, just that the assertion that efficient code is easier to understand. Logically, disputing that just requires a single instance of efficient code that is hard to understand. I think that's a trivial enough example to be self evident. In reality, I'm just wondering what they were trying to convey with that statement. I doubt they would…

Fair point.

It's possible when they said "efficient", they did not mean "hardware efficient, runs fast, doesn't use a lot of resources" but "developer efficient, faster to write and easier to understand". But that entire phrase as is doesn't make sense, I agree with that.

It's also possible to be a simple mistake. Maybe they went overboard with marketing phrases and claimed something that isn't quite true.

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#82
post #18

Anyone else not quite expecting StackExchange to be using a Microsoft stack?

Joel worked at MS on office, Excel if I recall correctly. Jeff's blog is named for a feature from a book published by MS. I would be more surprised if it was MS free.

"I started my career at Microsoft, a little software company outside of Seattle, where I was a program manager on the Excel team. My area was “programmability” and most of what I worked on in those days was replacing the Excel macro language (XLMs) with Excel Basic, and providing an object-oriented interface to Excel. Excel Basic became Visual Basic for Applications and the OO interface is what you know as OLE Automation, a.k.a. IDispatch."

-- http://www.joelonsoftware.com/AboutMe.html

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#83
post #2

I've recently started using their micro-ORM Dapper, and I like it a lot. I get the performance of hand-coded SQL, but without the tedious mapping from SqlDataReader to my entity.

Another awesome one which I've used on a previous project is SqlFu, https://github.com/sapiens/SqlFu

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#84
post #42
post #33

> The cost of inefficient code can be higher than you think. Efficient code stretches hardware further, reduces power usage, makes code easier for programmers to understand. I'm curious what the reasoning is for "Efficient code ... makes code easier for programmers to understand". To my mind, efficient code (in this case, I assume coding to the hardware, as they mention elsewhere), has many benefits, but making it ea…

users=db.get("SELECT name FROM users WHERE group='admin'") is more efficient and understandable then: users=[]; tmp=db.get("SELECT name,group FROM users") for (i=0;i

Not to mention, you'd never write code like the second one in a .NET ecosystem, unless you were purposefully trying to write bad, unmaintainable code.

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#85
post #18

Anyone else not quite expecting StackExchange to be using a Microsoft stack?

One must wonder, how much better this setup would of scaled had it been a more appropriate webserver stack such as Linux/BSD + Apache/Nginx or similar. Perhaps less boxes would be needed, or with the same number of boxes, more concurrent users.

> Microsoft infrastructure works and is cheap enough

not as cheap as just paying your team to maintain the boxes. I wonder how many times in the past few years SE has needed to call Microsoft for support? Would a RHEL license still be cheaper (probably)? If something like CentOS then there would be no support cost unless you need to bring in an outside contractor (for a particularly nasty issue).

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#86
post #64

What I'd like to see is how much cache hit they add on each level of cache. I remember some presentation of the facebook images stack where less than 10% (if I remember well) of the requests actually hit the disks; it would be interesting to see the patterns for the whole SE galaxy.

It totally depends on what we are caching (e.g. the community bullettins or hot meta questions get a gazillion hits...)

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#87
post #27
post #18

Anyone else not quite expecting StackExchange to be using a Microsoft stack?

Anyone who knows Joel Spolsky would expect a MS stack :)

It's difficult to take pragmatic advice from someone who took the least pragmatic (and most expensive) route for a startup web company.

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#88
post #33

> The cost of inefficient code can be higher than you think. Efficient code stretches hardware further, reduces power usage, makes code easier for programmers to understand. I'm curious what the reasoning is for "Efficient code ... makes code easier for programmers to understand". To my mind, efficient code (in this case, I assume coding to the hardware, as they mention elsewhere), has many benefits, but making it ea…

Sometimes "efficient" and "easy to understand and be sure is correct" don't have to be mutually exclusive; see this example [1] of Java and Go. Note that the code is autogenerated, so it should be equally efficient. The Go version also happens to be very simple and no different than most humans would write by hand (without trying very hard to optimize). [1] https://gist.github.com/shurcooL/9f94bbd021b4693cf584

It's not clear to me what argument the example is supporting.

The Go code is very concise and the Java code is very verbose.

The Go code does look more efficient but what is ImpressionData? Where is it checking the string is valid utf8?

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#89

Can anyone provide context on "Heavy usage of static classes and methods, for simplicity and better performance." Is performance _really_ an issue here?

I find the opposition to static classes odd. Unless you need the data encapsulation of an object, why force people to create an object to call functions? I find too much C# code loves creating objects for no real purpose other than that's how it works. For SO, if we guess they max out around 2000 req/sec, then if a bunch of objects are being allocated for each request, there could be added GC pressure. From my own ex…

I think the real issue (although it doesn't seem to be an issue for SO) is testability. AFAIK, static classes cannot be mocked, and you are pretty much boxing yourself into only doing integration tests for everything. Not necessarily a bad way to go, just lots more setup per test.

Re: StackOverflow Update: 560M Pageviews a Month, 25 Servers

#90

Can anyone provide context on "Heavy usage of static classes and methods, for simplicity and better performance." Is performance _really_ an issue here?

I find the opposition to static classes odd. Unless you need the data encapsulation of an object, why force people to create an object to call functions? I find too much C# code loves creating objects for no real purpose other than that's how it works. For SO, if we guess they max out around 2000 req/sec, then if a bunch of objects are being allocated for each request, there could be added GC pressure. From my own ex…

A singleton object doesn't need to be re-allocated.
Post reply on HN