Re: Pharo disappears - revisited

Tim Mackinnon <[email protected]> Sun, 18 Jul 2021 00:46:58 +0200
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
--===============6523452821241841957==
Content-Type: multipart/alternative; boundary=Apple-Mail-BF1E2714-A4F1-4C39-BD80-9E5117A79DB9
Content-Transfer-Encoding: 7bit


--Apple-Mail-BF1E2714-A4F1-4C39-BD80-9E5117A79DB9
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

You could also try deploying something like the recent article on running Ph=
aro in Docker, while the Docker example might be interesting (and running it=
 on a DigitalOcean with a Linux server for $5/m) - I=E2=80=99m actually thin=
king that you could try deploying the same example alongside your app and se=
e it it dies the same way (Eg https://thepharo.dev/2021/02/24/running-pharo-=
9-in-docker/)

Many folks have had running apps with no problems, so I=E2=80=99m sure there=
 is some explanation - and dying the way you describe does sound like some o=
s resource issue (strange to get no log results from anywhere though).

While you are diagnosing this - you should be able to put the launch of your=
 app in an OS script that would at least restart it if it dies (I think Sven=
 has different examples of this - or the Docker example would also fairly ea=
sily enable that for you too).

Hope this might give you a few more avenues to explore.

Tim

Ps - stress testing your app does seem like a good idea, although if you wan=
t to repro something that happens after 12 hours, I would think you need som=
ething a bit more severe and I would look at some other stress tool like Gat=
ling or Jmeter and run it for 30 mins to an hour (or maybe your script - but=
 for much longer - but the above tools would might give you more feedback on=
 whether something is happening)

> On 17 Jul 2021, at 11:43, Sven Van Caekenberghe <[email protected]> wrote:
>=20
> =EF=BB=BFYou could try to follow the instructions at the end of https://gi=
thub.com/pharo-project/pharo/issues/9565
>=20
> Rebuild your image with the latest Pharo 9, Zinc HTTP Components and Seasi=
de, as well as your own code. Make sure to clean your pharo-local cache if y=
ou do not work in a new download. Make sure you use the latest VM.
>=20
>> On 17 Jul 2021, at 11:38, David Pennington <[email protected]> wrote:
>>=20
>> I have had long discussions on Diascord but to no avail.  Perhaps a new s=
tatement of the problem might help.
>>=20
>> I have a Pharo 9.0, MacOs M1 VM install where I run a Seaside app for my l=
ocal scale plastic model club. The club as only about 16 members so the traf=
fic is extremely light with most days the only such being search bots.
>>=20
>> The pages are mostly designed to display photos of member=E2=80=99s model=
s. The images are held on the server path. The data that makes up the pages i=
s held in my own (what I call) TinyKV (Key Value database). This database us=
es the Pharo Filesystem to save and retrieve JSON text files.
>>=20
>> The Pharo image doesn=E2=80=99t run for more than about 10 hours when it j=
ust disappears leaving no crash log or debug files. I have checked the datab=
ase software and all files are opened and closed correctly so there are no h=
anging file handles (unless the underlying code doesn=E2=80=99t clean up but=
 that=E2=80=99s a guess).
>>=20
>> The Pharo image is running on a brand new 8GB M1 MacMini and is the only c=
ode running on that machine.
>>=20
>> To test out my code, I recently ran what could be seen as a =E2=80=9CDeni=
al of Service=E2=80=9D attack on my own web site. The following is the code t=
hat I ran on my M1 MacBookAir under Pharo 9/M1 VM.
>>=20
>> | response content headers contentList|
>> Transcript show: Time now    printString; cr.
>> contentList :=3D OrderedCollection new.
>> 1 to: 2000 do: [ : i |=20
>>    response :=3D ZnClient new=20
>>   url: 'http://www.ipms-clacton.org.uk:8080/CNWHome';
>>   get;
>>   response.
>>    response :=3D ZnClient new=20
>>   url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?022020001.=
jpg';
>>   get;
>>   response.
>>=20
>> contentList add: response contents.
>> ].
>>=20
>> Transcript show: Time now    printString; cr.
>> ^ contentList=20
>>=20
>> This hit the website with 2000 non-stop requests for the home page and fo=
r one of the pages that gets its data from the database (where =E2=80=9C0220=
20001.jpg=E2=80=9D is a JSON file  whose content is=20
>> "{"dateOfRecord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster B=
III converted to Aries of EANS - Airfix (first mould) with M&E Lancastrian C=
onversion","imagePath" : "022020001.jpg=E2=80=9D}=E2=80=9D
>>=20
>> I have also tried this code with 250 millisecond wait.
>>=20
>> The server accepts all of these requests and even responds to other reque=
sts whilst this is happening so I can see nothing wrong with my code, be it t=
he Seaside or the database.
>>=20
>> I have run this code on a variety of machines under 8.0 and 9.0. I have r=
un it under VAST on Windows 10 and Windows 2012 Server in addition to on the=
 Mac. I have the same problem under 8.0 as 9.0 no matter which VM I use.
>>=20
>> What do I do next?
>> _______________________________________________
>> seaside mailing list
>> [email protected]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>=20
> _______________________________________________
> seaside mailing list
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

--Apple-Mail-BF1E2714-A4F1-4C39-BD80-9E5117A79DB9
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr">You could also try deployi=
ng something like the recent article on running Pharo in Docker, while the D=
ocker example might be interesting (and running it on a DigitalOcean with a L=
inux server for $5/m) - I=E2=80=99m actually thinking that you could try dep=
loying the same example alongside your app and see it it dies the same way (=
Eg&nbsp;<a href=3D"https://thepharo.dev/2021/02/24/running-pharo-9-in-docker=
/">https://thepharo.dev/2021/02/24/running-pharo-9-in-docker/</a>)</div><div=
 dir=3D"ltr"><br></div><div dir=3D"ltr">Many folks have had running apps wit=
h no problems, so I=E2=80=99m sure there is some explanation - and dying the=
 way you describe does sound like some os resource issue (strange to get no l=
og results from anywhere though).</div><div dir=3D"ltr"><br></div><div dir=3D=
"ltr">While you are diagnosing this - you should be able to put the launch o=
f your app in an OS script that would at least restart it if it dies (I thin=
k Sven has different examples of this - or the Docker example would also fai=
rly easily enable that for you too).</div><div dir=3D"ltr"><br></div><div di=
r=3D"ltr">Hope this might give you a few more avenues to explore.</div><div d=
ir=3D"ltr"><br></div><div dir=3D"ltr">Tim</div><div dir=3D"ltr"><br></div><d=
iv dir=3D"ltr">Ps - stress testing your app does seem like a good idea, alth=
ough if you want to repro something that happens after 12 hours, I would thi=
nk you need something a bit more severe and I would look at some other stres=
s tool like Gatling or Jmeter and run it for 30 mins to an hour (or maybe yo=
ur script - but for much longer - but the above tools would might give you m=
ore feedback on whether something is happening)</div><div dir=3D"ltr"><br></=
div><div dir=3D"ltr"><blockquote type=3D"cite">On 17 Jul 2021, at 11:43, Sve=
n Van Caekenberghe &lt;[email protected]&gt; wrote:<br><br></blockquote></div><bl=
ockquote type=3D"cite"><div dir=3D"ltr">=EF=BB=BF<span>You could try to foll=
ow the instructions at the end of https://github.com/pharo-project/pharo/iss=
ues/9565</span><br><span></span><br><span>Rebuild your image with the latest=
 Pharo 9, Zinc HTTP Components and Seaside, as well as your own code. Make s=
ure to clean your pharo-local cache if you do not work in a new download. Ma=
ke sure you use the latest VM.</span><br><span></span><br><blockquote type=3D=
"cite"><span>On 17 Jul 2021, at 11:38, David Pennington &lt;[email protected]=
.uk&gt; wrote:</span><br></blockquote><blockquote type=3D"cite"><span></span=
><br></blockquote><blockquote type=3D"cite"><span>I have had long discussion=
s on Diascord but to no avail. &nbsp;Perhaps a new statement of the problem m=
ight help.</span><br></blockquote><blockquote type=3D"cite"><span></span><br=
></blockquote><blockquote type=3D"cite"><span>I have a Pharo 9.0, MacOs M1 V=
M install where I run a Seaside app for my local scale plastic model club. T=
he club as only about 16 members so the traffic is extremely light with most=
 days the only such being search bots.</span><br></blockquote><blockquote ty=
pe=3D"cite"><span></span><br></blockquote><blockquote type=3D"cite"><span>Th=
e pages are mostly designed to display photos of member=E2=80=99s models. Th=
e images are held on the server path. The data that makes up the pages is he=
ld in my own (what I call) TinyKV (Key Value database). This database uses t=
he Pharo Filesystem to save and retrieve JSON text files.</span><br></blockq=
uote><blockquote type=3D"cite"><span></span><br></blockquote><blockquote typ=
e=3D"cite"><span>The Pharo image doesn=E2=80=99t run for more than about 10 h=
ours when it just disappears leaving no crash log or debug files. I have che=
cked the database software and all files are opened and closed correctly so t=
here are no hanging file handles (unless the underlying code doesn=E2=80=99t=
 clean up but that=E2=80=99s a guess).</span><br></blockquote><blockquote ty=
pe=3D"cite"><span></span><br></blockquote><blockquote type=3D"cite"><span>Th=
e Pharo image is running on a brand new 8GB M1 MacMini and is the only code r=
unning on that machine.</span><br></blockquote><blockquote type=3D"cite"><sp=
an></span><br></blockquote><blockquote type=3D"cite"><span>To test out my co=
de, I recently ran what could be seen as a =E2=80=9CDenial of Service=E2=80=9D=
 attack on my own web site. The following is the code that I ran on my M1 Ma=
cBookAir under Pharo 9/M1 VM.</span><br></blockquote><blockquote type=3D"cit=
e"><span></span><br></blockquote><blockquote type=3D"cite"><span>| response c=
ontent headers contentList|</span><br></blockquote><blockquote type=3D"cite"=
><span>Transcript show: Time now  &nbsp; &nbsp;printString; cr.</span><br></=
blockquote><blockquote type=3D"cite"><span>contentList :=3D OrderedCollectio=
n new.</span><br></blockquote><blockquote type=3D"cite"><span>1 to: 2000 do:=
 [ : i | </span><br></blockquote><blockquote type=3D"cite"><span> &nbsp; &nb=
sp;response :=3D ZnClient new </span><br></blockquote><blockquote type=3D"ci=
te"><span> &nbsp;&nbsp;url: 'http://www.ipms-clacton.org.uk:8080/CNWHome';</=
span><br></blockquote><blockquote type=3D"cite"><span> &nbsp;&nbsp;get;</spa=
n><br></blockquote><blockquote type=3D"cite"><span> &nbsp;&nbsp;response.</s=
pan><br></blockquote><blockquote type=3D"cite"><span> &nbsp; &nbsp;response :=
=3D ZnClient new </span><br></blockquote><blockquote type=3D"cite"><span> &n=
bsp;&nbsp;url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?02202=
0001.jpg';</span><br></blockquote><blockquote type=3D"cite"><span> &nbsp;&nb=
sp;get;</span><br></blockquote><blockquote type=3D"cite"><span> &nbsp;&nbsp;=
response.</span><br></blockquote><blockquote type=3D"cite"><span></span><br>=
</blockquote><blockquote type=3D"cite"><span>contentList add: response conte=
nts.</span><br></blockquote><blockquote type=3D"cite"><span>].</span><br></b=
lockquote><blockquote type=3D"cite"><span></span><br></blockquote><blockquot=
e type=3D"cite"><span>Transcript show: Time now  &nbsp; &nbsp;printString; c=
r.</span><br></blockquote><blockquote type=3D"cite"><span>^ contentList </sp=
an><br></blockquote><blockquote type=3D"cite"><span></span><br></blockquote>=
<blockquote type=3D"cite"><span>This hit the website with 2000 non-stop requ=
ests for the home page and for one of the pages that gets its data from the d=
atabase (where =E2=80=9C022020001.jpg=E2=80=9D is a JSON file &nbsp;whose co=
ntent is </span><br></blockquote><blockquote type=3D"cite"><span>"{"dateOfRe=
cord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster BIII converted=
 to Aries of EANS - Airfix (first mould) with M&amp;E Lancastrian Conversion=
","imagePath" : "022020001.jpg=E2=80=9D}=E2=80=9D</span><br></blockquote><bl=
ockquote type=3D"cite"><span></span><br></blockquote><blockquote type=3D"cit=
e"><span>I have also tried this code with 250 millisecond wait.</span><br></=
blockquote><blockquote type=3D"cite"><span></span><br></blockquote><blockquo=
te type=3D"cite"><span>The server accepts all of these requests and even res=
ponds to other requests whilst this is happening so I can see nothing wrong w=
ith my code, be it the Seaside or the database.</span><br></blockquote><bloc=
kquote type=3D"cite"><span></span><br></blockquote><blockquote type=3D"cite"=
><span>I have run this code on a variety of machines under 8.0 and 9.0. I ha=
ve run it under VAST on Windows 10 and Windows 2012 Server in addition to on=
 the Mac. I have the same problem under 8.0 as 9.0 no matter which VM I use.=
</span><br></blockquote><blockquote type=3D"cite"><span></span><br></blockqu=
ote><blockquote type=3D"cite"><span>What do I do next?</span><br></blockquot=
e><blockquote type=3D"cite"><span>__________________________________________=
_____</span><br></blockquote><blockquote type=3D"cite"><span>seaside mailing=
 list</span><br></blockquote><blockquote type=3D"cite"><span>[email protected]=
queakfoundation.org</span><br></blockquote><blockquote type=3D"cite"><span>h=
ttp://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</span><br>=
</blockquote><span></span><br><span>________________________________________=
_______</span><br><span>seaside mailing list</span><br><span>[email protected]=
queakfoundation.org</span><br><span>http://lists.squeakfoundation.org/cgi-bi=
n/mailman/listinfo/seaside</span><br></div></blockquote></body></html>=

--Apple-Mail-BF1E2714-A4F1-4C39-BD80-9E5117A79DB9--

--===============6523452821241841957==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kc2Vhc2lkZSBt
YWlsaW5nIGxpc3QKc2Vhc2lkZUBsaXN0cy5zcXVlYWtmb3VuZGF0aW9uLm9yZwpodHRwOi8vbGlz
dHMuc3F1ZWFrZm91bmRhdGlvbi5vcmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3NlYXNpZGUK

--===============6523452821241841957==--