Code review comment for lp:~zhuzhaoyuan/mysql-proxy/zhuzhaoyuan

Revision history for this message
Kay Roepke (kay-roepke) wrote :

"Any response?"

sorry, been out of town.
There are a couple issues here:
1) rlim_t is different things to different "unixes". On OS X (where I wrote the code) it's __uint64_t. On Linux it seems to be a signed int64... I haven't checked other platforms yet.
In any case, it should be a 64 bit integer, so llu seems appropriate. I'm actually running 32 bit binaries here and output seems to be fine. The only problem is that OS X does not seem to correctly give back 'unlimited', nor can you set NOFILES to 'unlimited' by using the macro for it. Apple seems unwilling to fix this, instead they changed their docs from 10.4 to 10.5 pointing this out (the current maximum value you can use is OPEN_MAX == 10240, btw).
2) Raising the hard limit needs root permissions. Now, you could argue that setting rlim_max = max_open_files will work, because either
   a) max_open_files is lower then rlim_max and if it's lower then we are fine or
   b) max_open_files is larger then rlim_max (and transitively is larger than rlim_cur) thus we will fail anyway.
My only objection is that there's no real value in modifying the hard limit, because it would not make a difference. I doubt that we would get a signal for exceeding the soft limit of NOFILES, but I might be wrong. If we do, we could try to further increase the soft limit, but if we lowered the hard limit that would not be an option any more. Of course, none of that code has been written yet.

« Back to merge proposal