Optimizing logging calls to reduce requests#
Related error
Experiencing connection interruptions. Will try to reestablish communication with Neptune. Internal exception was: HTTPTooManyRequests
To avoid sending too many requests to the Neptune server too frequently, there may be things you can do to optimize your logging calls.
Series#
If you're logging a series, you can use the extend()
method instead of append()
.
The below involves ten logging calls:
The following results in the same metadata structure, but involves a single logging call:
The tradeoff is that in the first case, values are logged almost as soon as they are generated. This is not the case with the latter.
Files#
Instead of uploading files one by one with upload()
(resulting in one File
field for each file) you could do one of the following:
- Upload the files in batch with
upload_files()
(results in aFileSet
field) - Create a series of files with
append()
orextend()
(results in aFileSeries
field)