Sunday, June 28, 2015

Spring Batch

Awesome but complex presentation: https://www.youtube.com/watch?v=CYTj5YT7CZU by Michael Minella https://github.com/mminella

Michael Minella is the author of Pro Spring Batch

This book https://www.packtpub.com/application-development/spring-batch-essentials Spring Batch Essentials is probably more suitable for beginners.

On the whole I was not too impressed with the product. Fine, it provides a nice model and framework, but its reliance on XML configuration is a VERY bad choice - the usual frightening experience of visual cacophony with XML hits hard on my nerve.... why not JSON, or better still, why not a Java configurator.... in general the examples with Spring syntax (Cast) context.lookup("mybean") is simply unreadable, and very much against Dependency Injection style.



Monday, June 15, 2015

NUMA and JVM performance

Apparently there is a 40% performance gain to be made configuring the JVM to take advantage of the NUMA architecture. Just pass the -XX:+UseNUMA flag to your JVM.

To check if your hardware is NUMA enabled, run numactl:

numactl --hardware

For instance I get

available: 1 nodes (0)
node 0 size: 15897 MB
node 0 free: 344 MB
node distances:
node   0 
  0:  10 



which probably means I have no NUMA since I have a single node. You can also run numastat.

It's interesting also to run taskset:

taskset -c -p 5794

pid 5794's current affinity list: 0-3

to determine to which CPUs a given process is associated. Apparently this is quite important for memory allocation/deallocation performance - I still don't understand how :o(

See also this http://www.glennklockwood.com/comp/affinity.php



Wednesday, June 10, 2015

chmod 2773 and setgid : group permission allowing other users to delete a file

If you find yourself unable to delete a file created by FTPS, because in the transfer the group ownership was set to a group different from the one of the local user....

then you might want to try setting the DIRECTORY permissions to 2773 (setting the setgid bit on group level): this should allow any user to DELETE (but not change, I guess) files in that folder.

mkdir pippo
chmod 2773 pippo
ls -ltrad pippo
drwxrws-wx 2 pierluigi users 1024 Jun 10 10:27 pippo


notice the "s" in the permission group

See also http://docs.oracle.com/cd/E19683-01/816-4883/secfile-69/index.html

"When setgid permission is applied to a directory, files that were created in this directory belong to the group to which the directory belongs, not the group to which the creating process belongs. Any user who has write and execute permissions in the directory can create a file there. However, the file belongs to the group that owns the directory, not to the user's group ownership. "

Saturday, June 6, 2015

Charlie Hunt Java performance book



This is an excellent technical book which should not be missing from our library. When a real EXPERT and ENGINEER writes a book, you can feel the difference.

Watch also this excellent presentation https://www.youtube.com/watch?v=4joWshvFJnw

Friday, June 5, 2015

Web Development = madness

I have taken up lately the challenge to develop a web application based on some JS technology.

I have installed node.js with npm. I have tried AngularJS2 and AngularJS. I have tried EmberCLI, yeoman amd JHipster. I have tried MongoDB.

My impression is there we are in presence of a galaxy in full expansion, where new products are born every day and live a random, erratic life, and the correlation of technologies is decreasing.

Most products are VERY poorly documented, very brittle and work probably on some platforms and not others (although they claim to run on all), hardly compatible with each other, don't have an integrated IDE where one can develop and test stuff without having to run 4 parallel scripts.

After the fifth attempt to create myself a development environment and face an undocumented showstopper, I give up.

Besides, I believe JavaScript is a dramatically un-debuggable technology, and so are the tools developed to support it.

The fact that the Web - the most screwed up technology on the World - is taking this new dead end street is only confirming that when some engineering task is given to the wrong people - fanatics enthusiasts with little programming experience and without good mathematical background - you can only end up in a BIG BALL OF MUD.