I feel like this is such a niche question so I will try to explain it as best possible as I can.
Intro: I'm sending ~500 requests / second and I feel like the more requests I send the slower the requests are handled (it becomes noticeably slower at some point)
Question: So the question is in Java is there any way to prioritize a request? Any solution that I am seeking is to optimize the speed of such request.. So any answer that would take time before the request is sent is not of my concern.
INFO: (I hope this is sufficient if not please tell me!)
- The library I am using is apache httpclients (however I can switch if the solutions calls for it)
- I also am multi threading the requests on one server/pc. I hope this is helpful information.
- CPU Usage varies from (5-15%) - I believe these are the measurements

I am sending 2 types of request and I only need to prioritize 1 type
- HTTP GET Request - HTML Response expected
- HTTP POST Request - JSON response expected (although I do not need the response)
#2 is the request that I want to prioritize. I send this request very little but when I send it I need it to be as quick as possible.
Solutions thought of: The only solution I have come up with is to stop/end all of the live connections in order to execute the request I want, however I think that doing so will take a considerable amount of time causing the solution to become a waste of time.
Note: You could say I am an idiot in this area so if the solution is non existent or obvious I am sorry, also if there is a duplicate I am also sorry.. I could not find any questions even close to this.
prioritization. But you will very soon find out that : 1) very few support HTTP/2 2) even less correctly implement prioritization (if they do at all). What we ended up doing is have two thread pools before the request is send to the server. One of them has threads withThread.MAX_PRIORITYand the other oneThread.MIN_PRIORITY. Based on the path in the request we are supposed to make, we handle that.../high-priority-> pool with thread withThread.MAX_PRIORITY-> actual client and.../everything-else-> pool with thread withThread.MIN_PRIORITY-> actual client. This has somehow worked. We are still to find a more viable solution.