This is really annoying. Why something has to be simple if it can be complicated?
For some reason on Mac OS X commands: 'ulimit' and 'sysctl' works fine but are actually useless. Don't count on them if you want to change maximum number of open files in your system. Fortunately this forum threads comes to help. To save you from reading through all of this here is how it goes:
To check limits on your system run: 'launchctl limit'. To change max number of open files run: 'launchctl limit maxfiles 400000 unlimited'. To change the setting permanently add to the file: '/etc/launchd.conf' following line:
limit maxfiles 400000 unlimited
This doesn't however work for maxproc setting and please don't ask my why. I am asking...
Let's say we have N queues with packets waiting for processing. Queues are indexed from 0..N-1. Queue no 0 is the highest priority. Queue no N-1 is the lowest priority. Packets are being added to all queues asynchronously all the time and there is one thread reading packets from the queues.
How to efficiently empty all the queues in a single thread and make sure packets from the highest priority queues are always processed as soon as possible.
// Queues are kept in a map as below.
// EnumMap<Priority, LinkedBlockingQueue<Packet>> queues
while (! stopped) {
try {
// Your code starts here:
................
// Your code ends here.
// Let's make sure there was nothing added to any queue in the meantime
synchronized (queues) {
boolean added = false;
for (LinkedBlockingQueue<Packet> tmpqueue : queues.values()) {
if (added = (tmpqueue.size() > 0)) {
break;
}
}
if (!added) {
queues.wait();
}
}
} catch (Exception e) {
log.log(Level.SEVERE, "[" + getName() +
"] Exception during packet processing: " + packet.toString(), e);
} // end of try-catch
} // end of while (! stopped)
Any suggestions are very welcomed.
Have a look at this article about increased DDOS attacks on the services driven by the bot nets. In fact bot nets drive attacks but the real vehicles they drive are millions of Windows machines over the Internet.
Linux might be not the friendlies operating system yet. There are problems with hardware yet which make it difficult to use sometimes. But maybe defending yourselves and others from intruders is worth the extra effort. On the other side I am sure the more of us use the Linux the more hardware vendors add Linux drivers for their hardware.
Sometimes, when you change the Emacs version and you have own or custom Emacs packages installed and compiled with the previous version you may get unexpected behavior, including invalid function c-point warning message. The best solution for this is recompiling your *.el files using the current Emacs version:
Remove all old *.elc pre-compiled files:
find site-lisp/ -name "*.elc" -print | xargs rm -f
Recompile all Emacs source code files:
emacs --batch --eval "(byte-recompile-directory \"site-lisp/\" 0)"
The simple bash loop to do something with all files in the directory is:
for f in * ; do echo $f ; done
which just displays all files in this case.
This is easy, what I usually need and often forget how to do it is to execute some action exact number of times. Something like simple for loop in C or Java. And there is an exact match for such loop in Bash too:
for (( i=1 ; i<=100 ; ++i )) ; do echo $i ; done
I found another similar solution on the Internet today at spiralbound.net:
for i in $(seq 1 100); do echo $i ; done
which might useful in some cases...
I used to use KMail for years. It had some issues especially with IMAP accounts but worked fine for the most of the time and problems could be easily avoided by careful usage.
The Mail however in Mac OS X is completely different story. It is quite stable and better at using the IMAP accounts but it is consistently annoying in certain places.
Well, the installation went smooth and without any problems. I have made one mistake though. For some unknown to me reason I selected Mac UK keyboard as one of final settings. After restart there was no way to login or change the settings. Now reinstalling Gentoo again.
Very short guide for those who are interested how to install Gentoo in less then 30 minutes:
Now you can run Gentoo Linux Installer (GTK+) and if you select Networkless installation you have Gentoo system setup in less then half an hour.
Well, I am not really sure whether I install Linux on Macbook as a primary OS. However I miss the days when I used Linux as my development platform and there are some stuff in Mac OS X I just can't get used to.
So the day has come and I am installing Gentoo inside VMWare Fusion. The Macbook Pro has enough power to run both at the same time and with 4GB RAM on board there is enough for both systems. I hope this was I can use benefits from both worlds without sacrificing anything. On top of that I normally use 2 screens - one built-in the laptop and the second on the external monitor. This way I can use both system in full screen mode.
I tried both VM available for Mac OS X: Parallels and VMWare. I wanted to install amd64 Gentoo version. Parallels doesn't support 64bit systems at all so it lost at the beginning and it hang a few time so hard, I couldn't even kill -9 it. Well, this is something for OS to blaim for... VMWare claims it does. It even boots system from CD. During installation however it hangs too. The CD is not broken, nor the installation program is as www.tigase.org has been installed from this CD.
The Gentoo is installing right now in VMWare, let see how it goes...
I am generally happy with the Mac OS X installed on my Macbook. It is quite a good system and in most cases it works as expected.
Sometimes however it drives my crazy. I don't think this is a system created for software developers. At least not for software developers who work on the networking software.
I tried to do final tests over my Tigase Jabber/XMPP Server server and just couldn't do what I needed. One of the tests, called performance test, require sending 1000 messages over concurrent 1000 network connections between the Testsuite and the Tigase server. Whatever I did, I couldn't successfully open more than 900 concurrent connections. I tried to play with numerous setting, like maximum opened files, file descriptors, tweaking TCP/IP settings, nothing helped.
On Linux I can easily manage to open 60k connections and all works fine without failure. I wonder whether this is kind of a hidden configuration parameter or maybe it is a desktop version of the Mac OS X feature and to open more connections I have to have server version...
Any suggestion or help with forcing Mac OS X to handle more network connections would be very much appreciated. Otherwise I will probably replace the nice system with the system which works...
I always wondered if the multi-core or hyper-threading technology is only marketing thing or ot really gives you a significant performance boost in your system. I mean home based system not in enterprise servers. Are all those core really used and given that you have a shared memory and a shared hard drive can you make use of all those cores.
I had to replace my old server which hosts all tigase.org services (websites, e-mails, Jabber/XMPP, SVN, project tracking....) as it couldn't cope with the load and it had too little memory. And as usually upgrading memory in old systems is much more expensive that buying memory for the new machine.
At the end I decided to build a new server from scratch. 64bits, 4GB RAM, 500GB HDD in Raid-1 and a CPU. I wasn't really convinced for multi-core so I thought for a moment about buying multi-cpu motherboard. I coulnd't, however find any non-Xeon multi CPU motherboards and XEON motherboards were quite expensive, don't even mention about CPUs.
Ok, I turned back to multi-core. Quad core was not so much more than Dual then I gave it a go.
Gentoo installation was quite smooth and suprisingly fast. Even though I've put -j5 option just in case to the make command didn't believe too much in it.
The compilation was so quick so I wanted to see what is the real gain from the multicore system. The best test as usual is the kernel compilation. I ran compilation with a single thread and then two threads, three, four, five and six. Below are results:
| time | make all -j1 | make all -j2 | make all -j3 | make all -j4 | make all -j5 | make all -j6 |
| real | 12m58.898s | 6m46.075s | 4m44.324s | 3m56.030s | 3m48.276s | 3m46.681s |
| user | 11m42.690s | 11m48.650s | 11m53.350s | 11m59.490s | 12m7.560s | 12m11.010s |
Hm, colcusion: Number of CPU cores does really matter. Even in home based systems...
Recent comments
16 hours 14 min ago
3 days 16 hours ago
11 weeks 4 days ago
15 weeks 4 days ago
19 weeks 2 days ago
19 weeks 2 days ago
19 weeks 2 days ago
19 weeks 2 days ago
19 weeks 2 days ago
19 weeks 2 days ago