milek's blog
Wednesday, July 15, 2009
 
Windows 7
Alright Ben you've convinced me to try Windows 7 especially as you can download it and try it for free.

Friday, July 03, 2009
 
MySQL - 8x Performance Improvement
I came across an interesting problem today. A perl script running a mysql query and it takes too much time to complete. It spends almost all its time while waiting for this mysql query (anonymized):

select a, b, registered, c, d from XXX where date(registered) >= date_sub(date(NOW()),interval 7 day)

The problem is that there are over 70 million rows in the XXX table and the query takes over 7 minutes to complete mostly waiting for a disk I/O.

explain select a, b, registered, c, d from XXX where date(registered) >= date_sub(date(NOW()),interval 7 day)\G

id: 1
select_type: SIMPLE
table: XXX
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 72077742
Extra: Using where
1 row in set (0.02 sec)


So the reason it is so slow is that mysql does not use an index here. It turned out that if you use a function on a column in a where statement then mysql won't use an index!

There is a reason why the statement is using date() and date_sub() functions as it is expected to compare dates where time is 00:00:00 so I can't . But one can cast() functions to timestamp and used registered directly which will allow mysql to use index:
explain select a, b, registered, c, d from XXX where registered >= cast(date_sub(date(NOW()),interval 7 day) as datetime)

id: 1
select_type: SIMPLE
table: XXX
type: range
possible_keys: YYY
key: YYY
key_len: 9
ref: NULL
rows: 1413504
Extra: Using where
1 row in set (0.10 sec)
After the modification the script takes about 50s to execute compared to over 7 minutes which is a very nice 8x performance improvement! Not to mention a much less impact on a database server.

Monday, June 22, 2009
 
OpenSolaris Apps of Steel Challenge
Recently I participated in OpenSolaris Apps of Steel Challenge and I won a laptop!
My Toshiba Portégé® R600 arrived this morning and it comes pre-installed with Open Solaris. First impressions are really good - it is so light.

It is a fortunate coincidence that I'm on a short holiday right now as I will have more time to play with it :) Already doing an upgrade.

Thank you Sun you've made my day!

Friday, June 19, 2009
 
Intercepting Process Core Dumps
We disabled process core dumps on one of our environments but still we want to know when it happens along with some more information on the even.

root@ dtrace -q -n fbt:genunix:core:entry \
'{printf("%Y exec: %s args: %s cwd: %s pid: %d zone: %s signal: %d\n", \
walltimestamp, curpsinfo->pr_fname, curpsinfo->pr_psargs, cwd, pid, \
zonename, arg0);}' >/local/tmp/process_cores.log

Now lets try to kill a process so it tries to dump a core:

root@ bash -x
root@ kill -SIGBUS $$
+ kill -SIGBUS 14054
Bus Error (core dumped)
root@

root@ tail -1 /local/tmp/process_cores.log
2009 Jun 19 16:07:54 exec: bash args: bash -x cwd: /home/milek pid: 14054 zone: global signal: 10
root@
The overhead of running the script is practically none unless you're trying to dump as many core dumps as possible per second and even then the overhead should be relatively small :)

Thursday, June 18, 2009
 
Cognitive Computing via Synaptronics and Supercomputing (C2S2)
Cognitive Computing via Synaptronics and Supercomputing (C2S2):
"By seeking inspiration from the structure, dynamics, function, and behavior of the brain, the IBM-led cognitive computing research team aims to break the conventional programmable machine paradigm. Ultimately, the team hopes to rival the brain’s low power consumption and small size by using nanoscale devices for synapses and neurons. This technology stands to bring about entirely new computing architectures and programming paradigms. The end goal: ubiquitously deployed computers imbued with a new intelligence that can integrate information from a variety of sensors and sources, deal with ambiguity, respond in a context-dependent way, learn over time and carry out pattern recognition to solve difficult problems based on perception, action and cognition in complex, real-world environments."

 
Solaris Technologies Introduced for Oracle Database

 
Happy Birthday
Yesterday's LOSUG was a little bit surreal as we were singing happy birthday to OpenSolaris and had a birthday cake and a champagne.

Wednesday, June 17, 2009
 
VirtualBox 3.0.0 Beta1
This version is a major update. The following major new features were added:

In addition, the following items were fixed and/or added:

Tuesday, June 16, 2009
 
Turbo-Charging SVr4 Package Install
Have you ever been frustrated by slow patching or package installation on Solaris 10? Looks like the issue has been partially addressed by PSARC 2009/173. Hopefully it will be integrated into Solaris 10 soon.

Wednesday, June 10, 2009
 
GCC vs. Sun Studio
It all depends on your code, used options, etc. of course.
In a past I did some comparisons on my own and the difference usually wasn't that big and Studio not always provided better results - but that was couple of years ago.

Monday, June 08, 2009
 
Open Solaris on ARM

Wednesday, June 03, 2009
 
ld.so.1: picld: fatal: libpsvcobj.so.1: open failed: No such file or directory
If you noticed that 'prtdiag -v' doesn't print all information it should and you get a below error in a system log file:
picld[165]: [ID 740666 daemon.crit] ld.so.1: picld: fatal: libpsvcobj.so.1: open failed: No such file or directory
it means you probably hit bug: 6780957
There is a workaround proposed in the bug however if you are running on ZFS as a root-fs then:
"Due to the random nature of how ZFS stores files in a directory, the workaround may or may not work."
I was unlucky this time on one server and lucky on another one. Despite me trying to populate the plugins directory several times in different ways I was still unlucky. There are many ways how to workaround the issue. For example the below workaround works fine for me:
root# svccfg -s picl setenv LD_LIBRARY_PATH "/usr/platform/sun4u/lib"
root# svcadm refresh picl
root# svcadm restart picl

Tuesday, June 02, 2009
 
ZFS Snapshot Holds

 
Source Juicer - How to Contribute to OpenSolaris

Monday, June 01, 2009
 
Jülich


Powered by Blogger OpenSolaris Enthusiast