Link to home
Start Free TrialLog in
Avatar of Jay
Jay

asked on

Apache 404 error

Hello All,

We have scenario where USERs receive 404 error when one of xyz JVM is being recycled.
My understanding is Apache would detect when JVM is unhealthy and route request to healthy JVM instead of throwing 404 error to user.


About application:

We have 3 hosts. On each host we have one web instance (apache) and one standalone "xyz" JVM (jboss).
Apache workers is configured identical with all 3 "xyz" JVMs on 3 different hosts. We have other JVMs running on these servers with same setup but they don't have any issue.


Question

- Is there a setting in JBoss or Apache that I need to enable to avoid 404 errors?
- Also How long it takes web server to identify JVM is down before routing the request to other JVM? Do we have any setting to know the number?
Avatar of ArneLovius
ArneLovius
Flag of United Kingdom of Great Britain and Northern Ireland image

"My understanding is Apache would detect when JVM is unhealthy and route request to healthy JVM instead of throwing 404 error to user."

I think that your understanding is incorrect.

While it is possible that you have something written that Apache runs that is meant to do this, Apache does not do this natively.

I would suggest running a load balancer (such as HAPRoxy) to distribute load across the three hosts and with health checks to automatically remove hosts that respond with a 404 from the load balancing.
What kind of application are  you running in your JBoss server, is it running one or multiple applications. What load balancer are you using? modjk or other?

Your load balancer can detect if one of the 'workers' is not working properly, it then redirects to one of the others, based on the policy you've set. The load balancer will not give a '404' if a worker is not working as expected, it redirects. When your application in the JBoss container has an issue, then your JBoss container can give a '404' because of that.

Without you sharing more details about your setup, I doubt that experts can help you further, your question is too generally stated (xyz, jvm, apache, jboss) - no details.
As ArneLovius suggested, this is better done in HAProxy.

Determining if one JVM has died, then prune that JVM from rotation... Unsure exactly how you might do this in Apache.

This is an easy job for HAProxy.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.