-
Notifications
You must be signed in to change notification settings - Fork 138
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
Out of memory in go, after replicating one million records #20
Comments
Are you running 32-bit? Apparently the Go 1.0.3 garbage collector has known issues in 32-bit mode that can cause it to leak memory over time. I've seen posts on the Go mailing list saying that this causes HTTP servers to crash after a while. Switching to 64-bit avoids the problem. |
Yes! I'm running the 32 bit version! I'll install go 1.0.3 on a 64bit machine and I'll be back with more tests! |
Installed a fresh go 1.0.3 copy on a 12 Gb , 64 bit Linux machine! teo@teo:/var/www/identificare$ curl -X POST http://172.16.0.53:5984/_replicate -d '{"target":"http://172.16.0.53:5984/afoni","source":"http://172.16.0.53:4984/sync_gateway"}' -H "Content-Type: application/json" {"error":"changes_reader_died"} At changes.go , line 252 func (db *Database) GetChanges |
That could be the problem. We definitely haven't done any work on scalability or performance yet! It may be too early to start stress-testing the gateway ... at least unless you're interested in helping improve it :) |
Yes, we are interested in improving it! My collegue has already studied the source, he discovered that and he says that he knows how to make it work! Right now I am restarting the replication from scratch (after deleting the couchbase bucket) but with continuous replication. Until now it transferred more than 50% records and it seems to be stable! The "continuous replication" functions in go are scalable! I'll keep you informed. |
That'd be great! The obvious fix for the changes feed is to pass an IO writer to the function instead of having it return an array, so it can write the changes as JSON array elements one at a time. |
That's exactly what he plan to do ... |
I haven't been following this closely, but I will return a Not sure if it applies here, but if it could, I can help out with it. |
Just a short update for @snej , we are working on replication ... found a lot of bugs, my friend has solved most of them, we are testing right now with 2 millions records database, I'll come back with more info when it's ready! |
Great! Sorry about the bugs; we've definitely been working more on features than correctness, so far. It'll be great to have those fixes! |
@snej please get the modified files from https://mega.co.nz/#!jJcEgY4b!CR_h7FhCbLBgL4V6jdwOpxWTQ35ynVQgdF_ikd7wdYw With these changes, replication works now in both directions, continuous or normal replications, with or without channels! He made some optimisations in order to avoid to frequently changes to __seq , reserving a chunk of 200 numbers at a time, giving a 20% boost in replication speed. He added also some missed protocol headers and footers in JSON responses. You will find also there something about trying to change the sequnce that came form couchbase the supposed to be integer but it's coming as float and couchdb throws that "badarg" error when it's receiving it! |
Sorry, but I was unable to download the file from mega — first it complained that I wasn't using Chrome (I'm on the latest Safari), then it said it had downloaded the file but it didn't show up anywhere in my filesystem. I'm not willing to install a new browser just to download a 16kbyte patch! The best way to send patches is using a Github pull request. Alternatively, you can email it to me at jens at couchbase dot com. |
I just send them! |
FYI, a lot of the conversation has been via email, but the patches have now been committed. |
I build a CouchDB database with 2 millions documents containing 8 attributes (2 to 10 chars long) and a "channel" attribute with 2 strings.
Tried to replicate it to sync_gateway, after a hour (CouchBase reports already 2.587.000 records in data bucket) the go program has crashed with the following message
Running again the go program and trying to resume replication fails with the same message.
Teo
The text was updated successfully, but these errors were encountered: