Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2018 07:50:37 +0100
From:      Karli =?ISO-8859-1?Q?Sj=F6berg?= <karli@inparadise.se>
To:        Marcin Cieslak <saper@saper.info>
Cc:        ports@freebsd.org, ruby@freeebsd.org
Subject:   Re: monitoring ruby app memory usage with passenger-recycler (was: Cannot require library for passenger in ruby)
Message-ID:  <1519282237.1980.26.camel@inparadise.se>
In-Reply-To: <nycvar.OFS.7.76.6.1802202034350.2659@z.fncre.vasb>
References:  <nycvar.OFS.7.76.6.1802202034350.2659@z.fncre.vasb>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-pMZNubfP/BdZAwM60cNO
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2018-02-20 at 21:31 +0000, Marcin Cieslak wrote:
> On Mon, 19 Feb 2018, Karli Sj=C3=B6berg wrote:
>=20
> > > What is the tool you are trying to deploy? foreman_maintain?
>=20
> Sorry, I was too quick. This foreman_main is used to download/update
> foreman
> from RedHat Satellite servers, which is not what you want.

Well, I want the "foreman_maintain" package, which includes "passenger-
recycler", so I guess I do want it :)

>=20
> However, the passenger-recycler script is a standalone script which
> could possibly used with this little fix:

Ooh, awesome! Yeah, should=C2=B4ve figured since it=C2=B4s only at 0.1.3 :)

>=20
> https://github.com/theforeman/foreman_maintain/pull/143
>=20
> To apply this, please add files/patch-bin_passenger-recycler in the
> port I've sent before:
>=20
> --- bin/passenger-recycler.orig 2018-02-20 21:09:18 UTC
> +++ bin/passenger-recycler
> @@ -41,10 +41,10 @@ def process_status?(pid)
>  end
> =20
>  require 'phusion_passenger'
> +PhusionPassenger.locate_directories
>  require 'phusion_passenger/platform_info'
>  require 'phusion_passenger/platform_info/ruby'
>  require 'phusion_passenger/admin_tools/memory_stats'
> -PhusionPassenger.locate_directories
>  stats =3D PhusionPassenger::AdminTools::MemoryStats.new
>  unless stats.platform_provides_private_dirty_rss_information?
>    puts 'Please run as root or platform unsupported'

Yes, this works, thanks!

>=20
>=20
> But the real problem is that Passenger does think it supports
> getting process private dirty RSS memory information only on Linux:
>=20
> https://github.com/phusion/passenger/blob/219ad24159ae4033a342e6ad753
> cfee05d98bae0/src/ruby_supportlib/phusion_passenger/admin_tools/memor
> y_stats.rb#L121
>=20
> In file
> src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb:
>=20
> 120       def platform_provides_private_dirty_rss_information?
> 121         return os_name_simple =3D=3D "linux"
> 122       end
>=20
> This support probably would need to be written. So, unfortunately,
> passenger-recycler
> as written will exit with:
>=20
> 	Please run as root or platform unsupported

Yes, I have now gotten to this stage at least, thank you very much! I
don=C2=B4t mind having a look at it, it might be simplest thing to write, o=
r
it=C2=B4s hell, but I=C2=B4ll have a look!

Thank you for pointing me in the right direction!

/K

>=20
> But passenger-recycler does something very simple - if the amount of
> "private resident RSS
> memory" is higher than specified amount in the configuration file, it
> kills the process.
>=20
> You might get a much better monitoring on FreeBSD by monitoring the
> output of
>=20
> procstat -v <processid>
>=20
> which will give you details about the memory usage of the process and
> see how it is growing
> over time. Maybe you can pinpoint the shared library that causes
> this, if you are lucky.
>=20
> Marcin
--=-pMZNubfP/BdZAwM60cNO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iQEcBAABCAAGBQJajmg9AAoJEBpo164N2cuRFowH/3/n9zbuBp1cdrgU2V1jzdhP
Vhg31jJ60YfzIKnoSpneie69wJq2jVc5YxSu374MB55vpx+oAfBrqESchfb+OXTw
tp+EMoZfIG2eHBC3kzoEcInv9XB4fXMqFZdGFPREZ67S5ws1B9oU2Mm/m507U93o
k2IENLpPjEh9mgXKAsYyfpsvRbqnq7ePjzFSFIRS+H3n9PY9rI1S3YSOoz9tCa+P
nxRsZ8+kocO0MANUPu7DHPtPMl8jcskyl4YkXlGr2gIpmjZfIxOWqprBrfF72gU/
dGZVxaFP7ySPuNyU/ZDsvh+iF0twaKy21nOVptXzvoo4jowfRPGe4leafuKkGGw=
=F6f6
-----END PGP SIGNATURE-----

--=-pMZNubfP/BdZAwM60cNO--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1519282237.1980.26.camel>