I have had long discussions on Diascord but to no avail. Perhaps a new statement of the problem might help.
I have a Pharo 9.0, MacOs M1 VM install where I run a Seaside app for my local scale plastic model club. The club as only about 16 members so the traffic is extremely light with most days the only such being search bots.
The pages are mostly designed to display photos of member’s models. The images are held on the server path. The data that makes up the pages is held in my own (what I call) TinyKV (Key Value database). This database uses the Pharo Filesystem to save and retrieve JSON text files.
The Pharo image doesn’t run for more than about 10 hours when it just disappears leaving no crash log or debug files. I have checked the database software and all files are opened and closed correctly so there are no hanging file handles (unless the underlying code doesn’t clean up but that’s a guess).
The Pharo image is running on a brand new 8GB M1 MacMini and is the only code running on that machine.
To test out my code, I recently ran what could be seen as a “Denial of Service” attack on my own web site. The following is the code that I ran on my M1 MacBookAir under Pharo 9/M1 VM.
| response content headers contentList| Transcript show: Time now printString; cr. contentList := OrderedCollection new. 1 to: 2000 do: [ : i | response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWHome'; get; response. response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?022020001.jpg'; get; response.
contentList add: response contents. ].
Transcript show: Time now printString; cr. ^ contentList
This hit the website with 2000 non-stop requests for the home page and for one of the pages that gets its data from the database (where “022020001.jpg” is a JSON file whose content is "{"dateOfRecord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster BIII converted to Aries of EANS - Airfix (first mould) with M&E Lancastrian Conversion","imagePath" : "022020001.jpg”}”
I have also tried this code with 250 millisecond wait.
The server accepts all of these requests and even responds to other requests whilst this is happening so I can see nothing wrong with my code, be it the Seaside or the database.
I have run this code on a variety of machines under 8.0 and 9.0. I have 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.
What do I do next?
You could try to follow the instructions at the end of https://github.com/pharo-project/pharo/issues/9565
Rebuild your image with the latest Pharo 9, Zinc HTTP Components and Seaside, as well as your own code. Make sure to clean your pharo-local cache if you do not work in a new download. Make sure you use the latest VM.
On 17 Jul 2021, at 11:38, David Pennington david@lhdavid.co.uk wrote:
I have had long discussions on Diascord but to no avail. Perhaps a new statement of the problem might help.
I have a Pharo 9.0, MacOs M1 VM install where I run a Seaside app for my local scale plastic model club. The club as only about 16 members so the traffic is extremely light with most days the only such being search bots.
The pages are mostly designed to display photos of member’s models. The images are held on the server path. The data that makes up the pages is held in my own (what I call) TinyKV (Key Value database). This database uses the Pharo Filesystem to save and retrieve JSON text files.
The Pharo image doesn’t run for more than about 10 hours when it just disappears leaving no crash log or debug files. I have checked the database software and all files are opened and closed correctly so there are no hanging file handles (unless the underlying code doesn’t clean up but that’s a guess).
The Pharo image is running on a brand new 8GB M1 MacMini and is the only code running on that machine.
To test out my code, I recently ran what could be seen as a “Denial of Service” attack on my own web site. The following is the code that I ran on my M1 MacBookAir under Pharo 9/M1 VM.
| response content headers contentList| Transcript show: Time now printString; cr. contentList := OrderedCollection new. 1 to: 2000 do: [ : i | response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWHome'; get; response. response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?022020001.jpg'; get; response.
contentList add: response contents. ].
Transcript show: Time now printString; cr. ^ contentList
This hit the website with 2000 non-stop requests for the home page and for one of the pages that gets its data from the database (where “022020001.jpg” is a JSON file whose content is "{"dateOfRecord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster BIII converted to Aries of EANS - Airfix (first mould) with M&E Lancastrian Conversion","imagePath" : "022020001.jpg”}”
I have also tried this code with 250 millisecond wait.
The server accepts all of these requests and even responds to other requests whilst this is happening so I can see nothing wrong with my code, be it the Seaside or the database.
I have run this code on a variety of machines under 8.0 and 9.0. I have 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.
What do I do next? _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
You could also try deploying something like the recent article on running Pharo in Docker, while the Docker example might be interesting (and running it on a DigitalOcean with a Linux server for $5/m) - I’m actually thinking that you could try deploying the same example alongside your app and see 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’m sure there is some explanation - and dying the way you describe does sound like some os 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 easily 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 want to repro something that happens after 12 hours, I would think you need something a bit more severe and I would look at some other stress tool like Gatling 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 sven@stfx.eu wrote:
You could try to follow the instructions at the end of https://github.com/pharo-project/pharo/issues/9565
Rebuild your image with the latest Pharo 9, Zinc HTTP Components and Seaside, as well as your own code. Make sure to clean your pharo-local cache if you do not work in a new download. Make sure you use the latest VM.
On 17 Jul 2021, at 11:38, David Pennington david@lhdavid.co.uk wrote:
I have had long discussions on Diascord but to no avail. Perhaps a new statement of the problem might help.
I have a Pharo 9.0, MacOs M1 VM install where I run a Seaside app for my local scale plastic model club. The club as only about 16 members so the traffic is extremely light with most days the only such being search bots.
The pages are mostly designed to display photos of member’s models. The images are held on the server path. The data that makes up the pages is held in my own (what I call) TinyKV (Key Value database). This database uses the Pharo Filesystem to save and retrieve JSON text files.
The Pharo image doesn’t run for more than about 10 hours when it just disappears leaving no crash log or debug files. I have checked the database software and all files are opened and closed correctly so there are no hanging file handles (unless the underlying code doesn’t clean up but that’s a guess).
The Pharo image is running on a brand new 8GB M1 MacMini and is the only code running on that machine.
To test out my code, I recently ran what could be seen as a “Denial of Service” attack on my own web site. The following is the code that I ran on my M1 MacBookAir under Pharo 9/M1 VM.
| response content headers contentList| Transcript show: Time now printString; cr. contentList := OrderedCollection new. 1 to: 2000 do: [ : i | response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWHome'; get; response. response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?022020001.jpg'; get; response.
contentList add: response contents. ].
Transcript show: Time now printString; cr. ^ contentList
This hit the website with 2000 non-stop requests for the home page and for one of the pages that gets its data from the database (where “022020001.jpg” is a JSON file whose content is "{"dateOfRecord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster BIII converted to Aries of EANS - Airfix (first mould) with M&E Lancastrian Conversion","imagePath" : "022020001.jpg”}”
I have also tried this code with 250 millisecond wait.
The server accepts all of these requests and even responds to other requests whilst this is happening so I can see nothing wrong with my code, be it the Seaside or the database.
I have run this code on a variety of machines under 8.0 and 9.0. I have 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.
What do I do next? _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
If you have processes that exit „unexpectedly“ you can try to attach a debugger like lldb to the process. The debugger will automatically halt on exceptions like segmentation faults and such. You can also add breakpoints on „exit“ in order to see if something tells the app to quit. Or add a breakpoint at the end of „main“ to see if the app just thinks it can exit because there’s nothing more to do.
In addition to that you can of course add breakpoints in the image. But no idea where in Pharo you can add breakpoints. In VisualWorks I’d add breakpoints in the SubSystem classes in #tearDown where code is run when the image quits.
You can also try adding a breakpoint to ObjectMemory quit.
Karsten
—
Georg Heeg eK
Wallstraße 22 06366 Köthenx-apple-data-detectors://0
Tel.: 03496/214328tel:03496/214328 FAX: 03496/214712tel:03496/214712 Amtsgericht Dortmund HRA 12812
Am 17. Juli 2021 um 11:38:18, David Pennington (david@lhdavid.co.ukmailto:david@lhdavid.co.uk) schrieb:
I have had long discussions on Diascord but to no avail. Perhaps a new statement of the problem might help.
I have a Pharo 9.0, MacOs M1 VM install where I run a Seaside app for my local scale plastic model club. The club as only about 16 members so the traffic is extremely light with most days the only such being search bots.
The pages are mostly designed to display photos of member’s models. The images are held on the server path. The data that makes up the pages is held in my own (what I call) TinyKV (Key Value database). This database uses the Pharo Filesystem to save and retrieve JSON text files.
The Pharo image doesn’t run for more than about 10 hours when it just disappears leaving no crash log or debug files. I have checked the database software and all files are opened and closed correctly so there are no hanging file handles (unless the underlying code doesn’t clean up but that’s a guess).
The Pharo image is running on a brand new 8GB M1 MacMini and is the only code running on that machine.
To test out my code, I recently ran what could be seen as a “Denial of Service” attack on my own web site. The following is the code that I ran on my M1 MacBookAir under Pharo 9/M1 VM.
| response content headers contentList| Transcript show: Time now printString; cr. contentList := OrderedCollection new. 1 to: 2000 do: [ : i | response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWHome'; get; response. response := ZnClient new url: 'http://www.ipms-clacton.org.uk:8080/CNWShowOneImage?ab?022020001.jpg'; get; response.
contentList add: response contents. ].
Transcript show: Time now printString; cr. ^ contentList
This hit the website with 2000 non-stop requests for the home page and for one of the pages that gets its data from the database (where “022020001.jpg” is a JSON file whose content is "{"dateOfRecord" : ""owner" : "ab","text" : "1-72 Scale Airfix Lancaster BIII converted to Aries of EANS - Airfix (first mould) with M&E Lancastrian Conversion","imagePath" : "022020001.jpg”}”
I have also tried this code with 250 millisecond wait.
The server accepts all of these requests and even responds to other requests whilst this is happening so I can see nothing wrong with my code, be it the Seaside or the database.
I have run this code on a variety of machines under 8.0 and 9.0. I have 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.
What do I do next? _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
seaside@lists.squeakfoundation.org