Q:

hadoop ulimit open files name

I have a hadoop cluster we assuming is performing pretty "bad". The nodes are pretty beefy.. 24 cores, 60+G RAM ..etc. And we are wondering if there are some basic linux/hadoop default configuration that prevent hadoop from fully utilizing our hardware. 
There is a post here that described a few possibilities that I think might be true.
I tried logging in the namenode as root, hdfs and also myself and trying to see the output of lsof and also the setting of ulimit. Here are the output, can anyone help me understand why the setting doesn't match with the open files number.
For example, when I logged in as root. The lsof looks like this:
[root@box ~]# lsof | awk '{print $3}' | sort | uniq -c | sort -nr
   7256 cloudera-scm
   3910 root
   2173 oracle
   1886 hbase
   1575 hue
   1180 hive
    801 mapred
    470 oozie
    427 yarn
    418 hdfs
    244 oragrid
    241 zookeeper
     94 postfix
     87 httpfs
         ...

But when I check out the ulimit output, it looks like this: 
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 806018
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

I am assuming, there should be no more than 1024 files opened by one user, however, when you look at the output of lsof, there are 7000+ files opened by one user, can anyone help explain what is going on here? 
Correct me if I had made any mistake understanding the relation between ulimit and lsof. 
Many thanks!

A:

You need to check limits for the process. It may be different from your shell session:
Ex:
[root@ADWEB_HAPROXY3 ~]# cat /proc/$(pidof haproxy)/limits | grep open
Max open files            65536                65536                files     
[root@ADWEB_HAPROXY3 ~]# ulimit -n
4096

In my case haproxy has a directive on its config file to change maximum open files, there should be something for hadoop as well 

