how to know how many instances of an application are running on server
Use pstree -p do display process tree with pids of individual nodes. And then use the particular pid you want, and grep it from ps aux to see the CPU and memory consumption.

So the overall process will be:

$ pstree -p

init(1)─┬─apache2(6532)─┬─apache2(6575)
        │               ├─apache2(6576)
        │               ├─apache2(6716)
        │               ├─apache2(6803)
        │               └─apache2(6860)
        ├─cron(7474)
        ├─events/0(4)
        ├─getty(7507)
        ├─khelper(5)
        ├─klogd(7243)
        ├─ksoftirqd/0(3)
        ├─kthread(6)─┬─aio/0(64)
        │            ├─kblockd/0(19)
        │            ├─kjournald(693)
        │            ├─kjournald(7081)
        │            ├─kjournald(7082)
        │            ├─kjournald(7083)
        │            ├─kjournald(7084)
        │            ├─kjournald(7085)
        │            ├─kseriod(21)
        │            ├─kswapd0(63)
        │            ├─pdflush(61)
        │            ├─pdflush(62)
        │            ├─xenbus(8)
        │            └─xenwatch(7)
        ├─master(7414)─┬─pickup(6847)
        │              └─qmgr(7416)
        ├─migration/0(2)
        ├─mysqld_safe(7260)─┬─logger(7281)
        │                   └─mysqld(7280)───mysqld(7282)─┬─mysqld(7283)
        │                                                 ├─mysqld(7284)
        │                                                 ├─mysqld(7285)
        │                                                 ├─mysqld(7286)
        │                                                 ├─mysqld(7287)
        │                                                 ├─mysqld(7288)
        │                                                 ├─mysqld(7289)
        │                                                 ├─mysqld(7290)
        │                                                 └─mysqld(7291)


And then say you want to see the mysqld instance of pid 7285 's memory and cpu usage details:

$ ps aux | grep 7285
mysql     7285  0.0  2.9 58720 6016 ?        S    Feb04   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/blah.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
metin     6935  0.0  0.3  3300  724 ttyp0    R+   11:57   0:00 grep 7285


The third and fourh columns are CPU and memory respectively.