Help finding literature to tune batch options and influxdb.conf for better write performance?

Hello all,

Currently accessing InfluxDB v1.8.2 using influxdb-java v2.17 and I am struggling with abysmal write performance. Writing approx 1.2 million records to an instance of InfluxDB on localhost is taking approximately about 96 seconds, this is terribly slow for my application and it simply will not suffice. I do not understand how the actions and flushDuration options in InfluxDB enableBatch(final int actions, final int flushDuration, final TimeUnit flushDurationTimeUnit) interact amongst each other. This is an extremely detailed post I’ve written on the matter. I’ve gotten the org.influxdb.InfluxDBIOException: java.net.SocketException: Connection reset by peer: socket write error and from what I’ve read here, it has to do with the trio of max-concurrent-write-limit, max-enqueued-write-limit, and enqueued-write-timeout, but again, how don’t understand how to even decide these values. Absolutely any help whatsoever will be greatly appreciated. Thanks.