RejectedSoftware Forums

Sign up

Vibe.d leaking?

Hello,

When we start our servers based on vibe.d everything starts with a pretty small memory footprint and everything is pretty fast like expected.

However, after a while, typically a couple of hours but not always, our servers start swapping until a tool of ours which keeps pinging the servers times out and simply restarts the instances restarting the cycle - everything pretty fast, starts swapping, slow, restarted...

Anybody else with the same problem?
Trying to understand if this is a D problem, a Vibe.d problem? Our code seems to be pretty trivial, so it seems hard to be the cause of the problem :(

This problem used to be a lot worse, but on DMD 2.067 when the https://issues.dlang.org/show_bug.cgi?id=4890 bug got fixed, the problem got a lot more manageable. However, it's still not perfect and with our growth the restarts are getting a lot more frequent.

Thanks,
Mario

Re: Vibe.d leaking?

Am 25.10.2016 um 15:24 schrieb Mario Silva:

Hello,

When we start our servers based on vibe.d everything starts with a pretty small memory footprint and everything is pretty fast like expected.

However, after a while, typically a couple of hours but not always, our servers start swapping until a tool of ours which keeps pinging the servers times out and simply restarts the instances restarting the cycle - everything pretty fast, starts swapping, slow, restarted...

Anybody else with the same problem?
Trying to understand if this is a D problem, a Vibe.d problem? Our code seems to be pretty trivial, so it seems hard to be the cause of the problem :(

This problem used to be a lot worse, but on DMD 2.067 when the https://issues.dlang.org/show_bug.cgi?id=4890 bug got fixed, the problem got a lot more manageable. However, it's still not perfect and with our growth the restarts are getting a lot more frequent.

Thanks,
Mario

AFAIK, there are currently no known leaks in vibe.d, and my own services
appear to have stable memory usage, but who knows... Can you run a "dub
-b profile-gc" build for a while, and post the profiler log? There are
parts that allocate without the GC and the profile log isn't always
particularly meaningful (re-allocations are not handled in a meaningful
way), but it should be a good start.

Re: Vibe.d leaking?

On Tue, 25 Oct 2016 16:27:35 +0200, Sönke Ludwig wrote:

Am 25.10.2016 um 15:24 schrieb Mario Silva:

Hello,

When we start our servers based on vibe.d everything starts with a pretty small memory footprint and everything is pretty fast like expected.

However, after a while, typically a couple of hours but not always, our servers start swapping until a tool of ours which keeps pinging the servers times out and simply restarts the instances restarting the cycle - everything pretty fast, starts swapping, slow, restarted...

Anybody else with the same problem?
Trying to understand if this is a D problem, a Vibe.d problem? Our code seems to be pretty trivial, so it seems hard to be the cause of the problem :(

This problem used to be a lot worse, but on DMD 2.067 when the https://issues.dlang.org/show_bug.cgi?id=4890 bug got fixed, the problem got a lot more manageable. However, it's still not perfect and with our growth the restarts are getting a lot more frequent.

Thanks,
Mario

AFAIK, there are currently no known leaks in vibe.d, and my own services
appear to have stable memory usage, but who knows... Can you run a "dub
-b profile-gc" build for a while, and post the profiler log? There are
parts that allocate without the GC and the profile log isn't always
particularly meaningful (re-allocations are not handled in a meaningful
way), but it should be a good start.

Hi Sönke,

I tried that command but I don't find the log anywhere.
Where is the log file going?

Thanks,
Mario

Re: Vibe.d leaking?

Am 25.10.2016 um 17:25 schrieb Mario Silva:

On Tue, 25 Oct 2016 16:27:35 +0200, Sönke Ludwig wrote:

AFAIK, there are currently no known leaks in vibe.d, and my own services
appear to have stable memory usage, but who knows... Can you run a "dub
-b profile-gc" build for a while, and post the profiler log? There are
parts that allocate without the GC and the profile log isn't always
particularly meaningful (re-allocations are not handled in a meaningful
way), but it should be a good start.

Hi Sönke,

I tried that command but I don't find the log anywhere.
Where is the log file going?

Thanks,
Mario

Should be at ./profilegc.log - but I just noticed that LDC doesn't
support this mode, so you need to build with DMD.

Re: Vibe.d leaking?

On Wed, 26 Oct 2016 18:41:43 +0200, Sönke Ludwig wrote:

Am 25.10.2016 um 17:25 schrieb Mario Silva:

On Tue, 25 Oct 2016 16:27:35 +0200, Sönke Ludwig wrote:

AFAIK, there are currently no known leaks in vibe.d, and my own services
appear to have stable memory usage, but who knows... Can you run a "dub
-b profile-gc" build for a while, and post the profiler log? There are
parts that allocate without the GC and the profile log isn't always
particularly meaningful (re-allocations are not handled in a meaningful
way), but it should be a good start.

Hi Sönke,

I tried that command but I don't find the log anywhere.
Where is the log file going?

Thanks,
Mario

Should be at ./profilegc.log - but I just noticed that LDC doesn't
support this mode, so you need to build with DMD.

Hi Sönke,

Thanks, found it :)
I built this on my development machine and used 'ab' to make a 1000 requests to our index page with 100 concurrent requests.

It started occupying around 2.3% of memory in my machine and when I finished it was occupying 17.8%. My machine has 16GB of ram btw.

I then posted the log below but it simply discarded my message without giving me any error :( Is there a way I can send you the file other then having to copy the content here?

Thanks,
Mario

Re: Vibe.d leaking?

On Thu, 27 Oct 2016 09:38:27 GMT, Mario Silva wrote:

On Wed, 26 Oct 2016 18:41:43 +0200, Sönke Ludwig wrote:

Should be at ./profilegc.log - but I just noticed that LDC doesn't
support this mode, so you need to build with DMD.

Hi Sönke,

Thanks, found it :)
I built this on my development machine and used 'ab' to make a 1000 requests to our index page with 100 concurrent requests.

It started occupying around 2.3% of memory in my machine and when I finished it was occupying 17.8%. My machine has 16GB of ram btw.

I then posted the log below but it simply discarded my message without giving me any error :( Is there a way I can send you the file other then having to copy the content here?

Thanks,
Mario

I'd use http://pastebin.com or similar and then post the link.

Support for attachments is also planned, but not yet supported. I've opened a ticket for the missing error message: #37

Re: Vibe.d leaking?

On Thu, 27 Oct 2016 18:31:07 GMT, Sönke Ludwig wrote:

On Thu, 27 Oct 2016 09:38:27 GMT, Mario Silva wrote:

On Wed, 26 Oct 2016 18:41:43 +0200, Sönke Ludwig wrote:

Should be at ./profilegc.log - but I just noticed that LDC doesn't
support this mode, so you need to build with DMD.

Hi Sönke,

Thanks, found it :)
I built this on my development machine and used 'ab' to make a 1000 requests to our index page with 100 concurrent requests.

It started occupying around 2.3% of memory in my machine and when I finished it was occupying 17.8%. My machine has 16GB of ram btw.

I then posted the log below but it simply discarded my message without giving me any error :( Is there a way I can send you the file other then having to copy the content here?

Thanks,
Mario

I'd use http://pastebin.com or similar and then post the link.

Support for attachments is also planned, but not yet supported. I've opened a ticket for the missing error message: #37

Hi Sönke,

Duuh, of course :)
here it goes: http://pastebin.com/gPcYGtQU

Thanks,
Mario