Depends a bit on what nationality you have when doing UK immigration. And things like what time of day and whether you have Fast Track etc. However it would normally take under 2h, probably well under. But to be safe add an extra hour and a 3-4h connection would normally be plenty.
However these days are not normal. People are booking 4h connections even on ticketed connections. Bags are sometimes taking longer, immigration sometimes has long queues, etc....
That said. I would worry a lot less in this direction than the other. If you miss your EI flight worst case you have to book a new EI flight at full last-minute prices which would set you back a few hundred, not thousands.