This link has been bookmarked by 111 people . It was first bookmarked on 02 Mar 2006, by Joel Liu.
-
09 Feb 15
-
The #1 cause of context switches is having more active threads than you have processors. As the ratio of active threads to processors increases, the number of context switches also increases - linearly if you're lucky, but often exponentially
-
Personally, I think all flavors of select/poll and signals are ugly hacks, and therefore favor either AIO or completion ports, but it actually doesn't matter that much. They all - except maybe select() - work reasonably well, and don't really do much to address the matter of what happens past the very outermost layer of your program's front end.
-
Because the #2 cause of context switches is transferring work from one thread to another. Some people even compound the error by requiring that the response to a request be sent by the original thread - guaranteeing not one but two context switches per request
-
Thus, if it's possible to assert that no more than N items could ever be in use at once, preallocation at program startup might be a valid choice. Even when that's not the case, preallocating everything that a request handler might need right at the beginning might be preferable to allocating each piece as it's needed; aside from the possibility of allocating multiple items contiguously in one trip through the system allocator, this often greatly simplifies error-recovery code.
-
The basic idea is to put recently-freed objects onto a list instead of actually freeing them, in the hope that if they're needed again soon they need merely be taken off the list instead of being allocated from system memory
-
You now have a grid, where each cell represents a particular data set in a particular processing stage. What's most important is the following rule: two requests should not be in contention unless they are in the same data set and the same processing stage. If you can manage that, you've already won half the battle.
-
-
08 Sep 14
-
putting out the word
-
there still seem to be nuances that people miss.
-
drive you insane
-
go overboard
-
context switches are actually behind more total "meltdowns" at high load than data copies
-
-
01 Jul 13
-
22 Aug 12
-
01 Jul 12
-
15 May 12
-
15 Jan 12
-
15 Dec 11
-
31 Oct 11
-
This could be a very short section, for one very simple reason: most people have learned this lesson already. Everybody knows data copies are bad; it's obvious, right? Well, actually, it probably only seems obvious because you learned it very early in your computing career, and that only happened because somebody started putting out the word decades ago. I know that's true for me, but I digress. Nowadays it's covered in every school curriculum and in every informal how-to. Even the marketing types have figured out that "zero copy" is a good buzzword.
-
-
07 Oct 11
-
07 Sep 11
-
01 Jul 11
Ian WeatherhoggDo not:
Copy Data, Context Switch, Reclaim memory, Introduce Lock Contention
Full of good nuggets -
28 May 11
-
22 Mar 11
-
03 Feb 11
-
25 Jan 11
-
14 Jan 11
-
23 Oct 10
-
04 Sep 10
-
06 Aug 10
-
05 Aug 10
-
04 Aug 10
-
02 May 10
-
14 Feb 10
-
24 Jan 10
-
29 Nov 09
-
03 Nov 09
-
11 Sep 09
-
24 Apr 09
Steve Awesomeas the title says ... great essay
-
09 Apr 09
Tim Lossen"The purpose of this document is to share some ideas that I've developed over the years about how to develop a certain kind of application for which the term "server" is only a weak approximation. More accurately, I'll be writing about a broad class of pr
-
01 Mar 09
-
30 Jan 09
-
26 Aug 08
-
08 Jul 08
-
10 Jun 08
-
10 May 08
-
09 May 08
-
10 Apr 08
chunzhong zhangThe purpose of this document is to share some ideas that I've developed over the years about how to develop a certain kind of application for which the term "server" is only a weak approximation.
-
31 Mar 08
-
28 Mar 08
-
19 Feb 08
-
I find that the best thing to do is to identify the large objects in a program, such as data blocks, make sure those get allocated separately as described above so that they don't need to be copied, and not sweat too much about the other stuff.
-
-
21 Dec 07
-
08 Dec 07
-
30 Nov 07
-
25 Nov 07
jordimI'll be writing about a broad class of programs that are designed to handle very large numbers of discrete messages or requests per second.
-
12 Oct 07
-
10 Oct 07
-
05 Oct 07
-
27 Aug 07
Slobodan PavkovFour Horsemen of Poor Performance
article networking performance scalability tcp server programming design importedfromdelicious
-
25 Mar 07
-
24 Mar 07
-
01 Oct 06
-
27 Sep 06
-
18 Sep 06
-
25 Jul 06
-
09 Jul 06
-
20 Jun 06
-
06 Jun 06
-
02 May 06
-
08 Mar 06
-
17 Feb 06
Vivek K Sarticle enumerating causes of bad performance
programming performance server architecture network 2006 design software scalability articles
-
16 Feb 06
vikram_paranjapeServer architecture notes by Jeff Darcy at canned platypus blog
-
16 Nov 05
-
22 May 05
-
08 Apr 05
-
11 Feb 04
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.