News for hackers. Stuff that matters.
Re:Varnish guy's hatred for autoconf by djmdjm on Friday July 09, 2010 @01:50AM (#1499884)
Clearly autoconf isn't so unremittingly horrible that he doesn't use it in Varnish :)

autoconf is a bit of a Faustian bargain though - it promises a quick and easy solution to the labour-intensive and mindlessly boring task of managing all the microscopic differences between (and within!) Unix variants. Unfortunately it brings its own complexity, fragility and bugs along with it. It also encourages a programming style best described as "#ifdef hell" which is just poison to good maintainability.

Re:Varnish guy's hatred for autoconf by jacquesm on Friday July 09, 2010 @02:25AM (#1499939)
For the record, the 'varnish guy' is also one of the main people behind FreeBSD:

http://people.freebsd.org/~phk/

Varnish is a pretty good example of how far you can push a unix box in terms of network performance, one site I work for/with serves up billions of images daily using varnish without a single hickup.

If phk criticizes something it's usually worth listening to, he really knows his stuff.

Re:Varnish guy's hatred for autoconf by gruseom on Friday July 09, 2010 @01:00PM (#1501291)
I agree. His recent ACM article is an example: provocative and even unpleasant, but making a point which, if correct, could hardly be more important; and I think it is probably correct.

What do you think it is that makes Varnish so fast? I've read the article (http://varnish-cache.org/wiki/ArchitectNotes) but I'm curious to hear about it from people's experience. Sometimes the stated reasons for something being great are not the same as the real reasons.

Re:Varnish guy's hatred for autoconf by akkartik on Friday July 09, 2010 @03:12PM (#1501837)
Ah, here's the article: http://queue.acm.org/detail.cfm?id=1814327

Especially interesting to me because I spent 5 years on memory issues in grad school, steeped in the idea that number of comparisons or number of instructions per unit input is often a red herring. Unfortunately the alternative is a much more complex model to juggle in your head.

Re:Varnish guy's hatred for autoconf by gruseom on Saturday July 10, 2010 @01:13PM (#1503969)
(Sorry for not including the link to that one.)

Can you expand on this? What do you think of the article's argument and how does it relate to what you studied? Perhaps this should be in its own thread, but I'm really curious about this because, right or wrong, what he's advocating is not a common design style.

Re:Varnish guy's hatred for autoconf by akkartik on Saturday July 10, 2010 @05:58PM (#1504434)
Oh, he's right. More often than not, it's uncommon just because we're doing it wrong.

I spent a good couple of years thinking up layout optimizations like the one in Figure 6. I think that's fairly common design style, when people choose to think about this stuff. The challenge is coming up with consistently better layouts for a specific application. One benefit of java, for example, is that you can move things around without worrying about pointer arithmetic like in C.

And his rant about Figure 7 resonates. Again, it's brain-dead obvious that you should take the memory hierarchy of your system into account because you waste millions of cycles waiting on a disk read, but it's really hard to do. Our education system doesn't help, and neither do mainstream tools.

I think of it as concentric revolutions. The pentium's algorithm for processing instructions out-of-order first showed up in a mainframe 30 years before (http://en.wikipedia.org/wiki/Tomasulo_algorithm). The internet gradually rediscovers what desktop devs gradually rediscovered what the minicomputer devs originally dreamt up. Most of the time it's not common yet simply because people haven't gotten around to it.

It's basically YAGNI on the scale of industry segments. A successful startup will gradually make its infrastructure more stable and higher-performance after it's ensured it'll be around. And a successful new technology will first validate its reason for being before gradually trying to use what previous technologies have learned.

Sorry this is poorly written. I'm not sure what parts of this are non-obvious, so feel free to ask more questions.

Re:Varnish guy's hatred for autoconf by jacquesm on Friday July 09, 2010 @02:37PM (#1501708)
Using system calls the way they are intended to and building a server the way UNIX is meant to be used.

It's a textbook example of how to do a thing like this.

Re:Varnish guy's hatred for autoconf by gruseom on Saturday July 10, 2010 @01:03PM (#1503953)
Fair enough, but I want to know the key principles about how these are intended to be used. Or are you saying I should just read Stevens?

The major point I took from the articles is that you should let the kernel manage what's in RAM -- it's going to do it anyway, so don't fight it -- and instead of building complicated paging and caching mechanisms, focus on laying out your data to take advantage of how the kernel already does it.

What I want to know is, what are the other such major points?

p.s. Good luck tomorrow :)

Re:Varnish guy's hatred for autoconf by there on Friday July 09, 2010 @01:31PM (#1501430)
and also for the record, djm that you're replying to is one of the main maintainers of the portable OpenSSH project, which takes OpenBSD's OpenSSH code and has to add in all that "#ifdef hell" and deal with the autojunk tools to get it to build on the dozens of platforms that OpenSSH ships on.

http://openssh.org/portable.html

Re:Varnish guy's hatred for autoconf by cperciva on Friday July 09, 2010 @02:05AM (#1499900)
Clearly autoconf isn't so unremittingly horrible that he doesn't use it in Varnish :)

Autocrap is horrible in two ways: First, it's horrible to work with; and second, it's responsible for making any attempt to avoid it horribly painful.

If autocrap didn't exist, people would write operating systems without so many gratuitous incompatibilities. What possible excuse is there for the fact that many linux distributions need a special compiler flag in order to support files greater than 4 GB?

Re:Varnish guy's hatred for autoconf by djmdjm on Friday July 09, 2010 @02:22AM (#1499930)
In this case, I think the egg (autoconf) arrived on the scene well after the chicken (idiotic, gratuitous incompatibilities).
Re:Varnish guy's hatred for autoconf by cperciva on Friday July 09, 2010 @02:57AM (#1499997)
Absolutely. And I'd say that in the 90s autocrap was probably a net positive.

But times have changed. Windows is now more compatible with Linux than a random pair of mid-90s UNIXes were with each other. Now that the major incompatibilities gone, all autocrap is doing is keeping the lesser incompatibilities around.

Re:Varnish guy's hatred for autoconf by avar on Friday July 09, 2010 @09:28AM (#1500497)
The Windows compilers are more capable than old 90s compilers. But random source code written for Linux is a lot more compatible as-is with AIX, HP-UX, IRIX and others than with Windows.

Windows doesn't have forks (needs emulation via threads), second class support for things like symlinks, and isn't POSIX compatible (yes, I know you can get that as a separate install).

Porting a Linux program to Windows is like porting it to Novell, or some random mainfram OS. Not another OS in the Unix family.

Re:Varnish guy's hatred for autoconf by thyrsus on Friday July 09, 2010 @03:36AM (#1500065)
Just yesterday I was trying to get the macutils package built (http://www.ibiblio.org/pub/Linux/utils/compress/macutils.tar...) and wishing they had used autoconf instead of ad hac #ifdef'ing for each arbitrary environment they had encountered - which never happened to be standard C. The package is apparently unmaintained, and if it weren't for tracking down the license provenances(!), I'd be tempted to apply some autoconf love.

Varnish guy also left HP-UX off his list of still-kicking Unix implementations.

The continuing exponential growth of computer use hides the fact for many that there are still an enormous number of "non-mainstream" systems still in essential use. Within the last couple weeks, someone on the autoconf list just asked for help supporting AS400.

Kids these days. Sheesh. ;-)

Re:Varnish guy's hatred for autoconf by davidw on Friday July 09, 2010 @02:29AM (#1499945)
Isn't it a 90ies thing, when there were not just a few different Linux distributions, but several competing Unix systems? Solaris, IRIX, HPUX, AIX, Digital Unix, plus Linux, *BSD, and various and sundry other minor players.
Re:Varnish guy's hatred for autoconf by avar on Friday July 09, 2010 @09:35AM (#1500517)
Those systems are still around, and people are still porting software to them.

For instance Git which is a fairly popular package created in 2005 runs on at least: Linux, GNU, GNU/Hurd, GNU/Linux, Tru64 UNIX, GNU/kFreeBSD, SCO UnixWare, SCO UNIX SV, Darwin, various versions of Solaris, Cygwin, *BSD, AIX, IRIX, IRIX64, HP-UX, Windows, MINGW.

Older packages like Perl and Emacs compile on a much wider range of systems.

Re:Varnish guy's hatred for autoconf by jacquesm on Friday July 09, 2010 @03:15AM (#1500024)
There still are several competing UNIX flavors:

- bsd and derivates (including OS/X)

- linux (64 and 32 bit sub-flavors)

- QnX (though very different under the hood)

And lots of others. So 'it's an 80's thing' but it will be very hard to get rid of, 'just a few different linux distributions' does not describe the situation accurately.

It also isn't rare to find older boxes still chugging away quietly at some task in a corner somewhere running any one of those older operating systems and those sometimes need software compiled for them as well.

Re:Varnish guy's hatred for autoconf by davidw on Friday July 09, 2010 @03:27AM (#1500056)
What I meant is that autoconf was created in the 1990ies.