I have a high volume application that reads in data from files, and then hits an internal API (local network) via a POST with X number of records from the current file. I'm using HttpUrlConnection to make the API call. Without the API call, it runs extremely fast, but once I put in the API call, it slows down a lot, and doesn't seem to scale well (e.g. at 8 threads it's faster than at 2, but the per-thread performance is much lower).
Doing some searches, it appears that the underlying implementation appears to be doing connection pooling (generally a good idea), and uses an ConcurrentHashMap for the pooling according to HttpURLConnection implementation question. Should I try turning off the connection pooling? Or increase the size of the pool?