I have bitcoind installed on a quite powerful dedicated server.
For security reasons i've placed the front end site that uses it on separate shared hosting.
It has just some PHP scripts, mysql db and a basic site there, so I thought it would be OK BUT!
It seems that connections to bitcoind like connect checking, incoming payments checking... take a lot of time and work slow, and with just few users using the site simultaneously we hit the "Entry processes" limit on the host (which is 20).
I'm not sure if this is common issue or it's a problem with our code?
I'm looking for ideas to solve this problem
you should decouple your problem into smaller pieces that you can test.
make a script that runs on the same machine that is running bitcoind that performs many concurrent operations that you list (connect checking, incoming pmt check, etc). ideally this would be a shell script or something that doesn't use the php + mysql. the upshot is cut out the mysql + php stuff and test bitcoind first. if this is really slow, you may need to proxy bitcoind interactions.
after testing this, move on to the php and mysql. test php first by itself, so do not store tx in the db. this will give you info about php performance. add the mysql stuff last and you will have a pretty clear picture of what is bottlenecking.