pgsync icon indicating copy to clipboard operation
pgsync copied to clipboard

PGsync does not Immediately send document to Elastic Index

Open joshuafernandes1996 opened this issue 3 years ago • 7 comments

PGSync version: 2.2.1

Problem Description: Increase Indexing speed

@toluaina , the Sync is working fine, just that documents sometimes take 5-10 seconds to show up in the Index. Is there any way to increase the Speed.

Seems like Redis holds to documents for some time before sending them to the index. Any suggestions?

joshuafernandes1996 avatar Apr 24 '22 10:04 joshuafernandes1996

Yes, you can try:

  • increasing NTHREADS_POLLDB (default is 1)
  • reducing POLL_TIMEOUT (default is 0.1)

These are defined here

toluaina avatar Apr 26 '22 22:04 toluaina

Thank you @toluaina , I will get back to you after testing it out.

joshuafernandes1996 avatar Apr 27 '22 13:04 joshuafernandes1996

Hi @toluaina ,

Thank you for the PGSync. The sync works fine though we have an issue regarding sync speed.

We have around 360k documents in ES and it takes around ~5mins. to sync new inserts. Do you think, the amount of data could be the issue for this delay?? We tried increasing nthreads_polldb=10 and reducing poll_timout=0.05 but nothing changes.

chintal31 avatar May 05 '22 13:05 chintal31

@chintal31

are you suggesting you are seeing no difference at all ? Can you confirm which version of pssync you are running otherwise can you try the latest or use the master branch.

10 threads is a lot. Please start from 4.

toluaina avatar May 05 '22 21:05 toluaina

@chintal31

  • I have been working on an async feature branch.
  • You can pull the branch here.
  • It is not ready for production use yet.
  • but if you notice a performance improvement I can put more effort into completing it

thanks.

toluaina avatar May 20 '22 17:05 toluaina

PS: I have integrated the async branch into the master branch So you can just pull master and enable async mode with the environment variable

USE_ASYNC=True

toluaina avatar May 23 '22 21:05 toluaina

Hi @toluaina, we have done the changes you mentioned. We can definitely see improvements in syncing but there are times when it shows delay. Even when we updating a particular document the updated values also takes time(Not always though).

Is there anything else on the we can do on the Infra side? like polling or threading which can be tweaked to achieve optimum sync speed?

joshuafernandes1996 avatar Aug 09 '22 06:08 joshuafernandes1996