You should ask in ejabberd forums/mailing lists about ejabberd. Scalability is a tricky question with no template answer for every situation… you can read this on Openfire Explanation: scalability, system requirements
I know that Openfire can support more than 50k, but that depends on usage and system resources.
You should ask questions about your client in Smack forum, if you are using Smack library. Will get more looks that way.