error : BOOST DISABLE THREADS

The experimental GCC version 4.7 disables Boost.Threads. See: https://svn.boost.org/trac/boost/ticket/6165 Edit: It should be noted that as of the release version of GCC 4.7, and Boost higher than 1.48 (Boost_1_48_0 is still not working), threads works again.

How did WhatsApp achieve 2 million connections per server?

If you have enough RAM it’s not too hard to handle 1M or more connections on linux. These guys handled 10 million connections with a java application on a single box using regular CentOS kernel with a few sysctl tweaks: sysctl -w fs.file-max=12000500 sysctl -w fs.nr_open=20000500 ulimit -n 20000000 sysctl -w net.ipv4.tcp_mem=’10000000 10000000 10000000′ sysctl … Read more

How to increase limits on sockets on osx for load testing?

(answer updated to use -S as several commenters suggested) $ sysctl kern.maxfiles kern.maxfiles: 12288 $ sysctl kern.maxfilesperproc kern.maxfilesperproc: 10240 $ sudo sysctl -w kern.maxfiles=1048600 kern.maxfiles: 12288 -> 1048600 $ sudo sysctl -w kern.maxfilesperproc=1048576 kern.maxfilesperproc: 10240 -> 1048576 $ ulimit -S -n 256 $ ulimit -S -n 1048576 $ ulimit -S -n 1048576

Forcing the order of output fields from cut command

This can’t be done using cut. According to the man page: Selected input is written in the same order that it is read, and is written exactly once. Patching cut has been proposed many times, but even complete patches have been rejected. Instead, you can do it using awk, like this: awk ‘{print($2,”\t”,$1)}’ abcd.txt Replace … Read more

When would os.environ[‘foo’] not match os.getenv(‘foo’)?

os.environ is created on import of the os module, and doesn’t reflect changes to the environment that occur afterwards unless modified directly. Interestingly enough, however, os.getenv() doesn’t actually get the most recent environment variables either, at least not in CPython. You see, in CPython, os.getenv() is apparently just a wrapper around os.environ.get() (see http://hg.python.org/cpython/file/6671c5039e15/Lib/os.py#l646). So … Read more