-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate bulk load performance #1263
Comments
I have provided some my results of investigations in ticket #553
pageserver from delta layers: 220 sec I tried to implement yet another prefecth: neondatabase/postgres#133 So at least at local host prefetch seems to have no sense for seqscan. It will be interesting to repeat this experiment in the could. |
Also I noticeв that wal_log_hints significantly (~10 times) slowdown selects, because them are setting hint bits, them are walloged using FPI and as a result instead of just reading data from the disk we also have to writing the same amount of data. |
Insertion speed depends mostly on number of records, not on actual size of written data.
CPU usage of pageserver is about 100%. So looks like is it bottleneck now.
So most of time is spent in synchronization, despite to the fact that there are no local conflicts (GC and checkpointer are disabled). |
Interesting result based on profile and random stack traces inestigation: just commenting one line:
Allows to increase insert speed almost twice: 136 seconds vs. 230. |
I found bug in my prefetch implementation and after fixing the bug, it shows positive impact on performance. I used the following test to measure performance:
So, prefetch allows to speed up seqscan up to 2 times. With parallel plans improvement is not so large: 54 vs. 67 seconds. So, I updated PR for local prefetch neondatabase/postgres#133 and waiting for your review |
Something more about network communication latencies (once again results were produced at my notebook). This is ping-pong test which simulates get_page_at_lsn requests to page_server (16 bytes requests and 8Kb response). This test loads 3703704 which corresponds to size of table
Please notice that 8/1 mode is currently using in prefetch implementation (to avoid changes in page server). I tried to play with libpq/socket rx/tx buffers sizes, but looks like them have no much effect on performance. | |
With small (3Gb) table which completely fits in memory, effect of prefetch is almost the same: 21 vs 42 sec. Vanilla is able to sequentially scan this table in just 3 seconds (2807 msec). Time of local scan of relation inside postgres is 8 seconds. It is strange, but support of batch mode in page_server<->compute protocol (use pgb.write_message_noflush instead of pgb.write_message for all prefetched pages except last) has only negative impact on performance. |
I added a summary of all the ongoing investigations and patches to the issue description. Please update if I missed something. |
scratch that, I moved the summary to #2221 instead |
Backpressure is still needed, because we have one ore component processing WALs: safekeepers. |
@jcsp same here with batch ingestion question |
I think this ticket is still valid: we don't have good testing in place for the raw ingest performance. |
Follow-up on #1221. The first immediate cause of #1221 was that a GetPage request could not be interrupted. That was fixed. A second cause was that the backpressure was not enabled or not working correctly, which allowed a lot of unprocessed WAL to accumulate, so that a GetPage request with fresh LSN had to wait for the WAL backlog to be processed. Fixing backpressure will take care of that.
But the third cause was that the pageserver could not keep up with processing the WAL that was generated. If it could keep up, the backpressure would not be needed, and the GetPage request would've finished uickly. So why did the page server not keep up? A bug? Is WAL ingestion in page server too slow, and we need to speed it up? Was the production server overloaded?
The text was updated successfully, but these errors were encountered: