-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Thorsten,
On 10/17/19 05:34, Thorsten Schöning wrote: > Hi all, > > TL;DR: > > Is someone hosting web interfaces, web services etc. in > IoT-related projects using Tomcat? If so, under which hardware > requirements, especially CPU and RAM and using which frameworks/... > for the interface etc.? Did you do so in the past and might have > failed terribly, for what reasons? Without having ever tried to do anything like this, I have a few data points for you. First, Tomcat itself can fit into a very small heap space. Usually, the JVM plus Tomcat can run in about 12-16 MiB the last time I checked. The application itself is usually the memory hog. So watch out for frameworks who eat a lot of RAM. Also be aware that XML processing (e.g. Axis) is a memory hog, just because XML is verbose. You might want to consider NOT using SOAP at all for performance reasons. Also, nobody uses SOAP anymore :) I've had *great* success with the "Noggit" event-based JSON parser. It's the JSON parser that Solr uses when you upload a multi-gigabyte JSON document for indexing. I have an application that served hundreds of simultaneous users on a single node with a 64MiB heap. We only had to adjust the heap because (a) our cached data started growing and (b) our user's sessions started growing as well (mostly due to more users). (We have fixed the caching settings and we are now able to run thousands of users with a 512MiB heap). Second, I wouldn't want to run a JVM on anything which had as little as 128MiB of RAM. Linux itself can happily run in ~16 - 32 MiB of RAM, but everything adds a little. The JVM is pretty hefty and don't forget about caches: if the OS has to eliminate caches, your performance will drop like a rock. If you start to swap, memory-constrained Linux can really thrash and get no work done.[1] When you say that your desired 1GiB board doesn't "fit into battery-operated mode", what do you mean? How about something like RPi? Even the Pi Zero has 512MiB of RAM and all the wireless stuff you'll likely want. It's not exactly a powerhouse, but it should be able to run simple web services. I don't know about battery options, though. Hope that helps, - -chris > The background: > > I'm working on some IoT-project creating some device(s) with > currently only very few and vague requirements. Some of those > requirements are providing a web interface and web services, but > another one is that some variant of the device should be used in > some battery-powered context as well. If that should provide a web > interface/web services as well and how complex etc. still needs to > be discussed. > > Additionally, there's some cloud-based software with its own > frontend interacting with the predecessor of the newly created > device. That whole stack is implemented using Apache Tomcat, Wicket > and Axis 2 and because we are a pretty small company and stuff I > would like to reuse as much of that stack as possible and somewhat > reasonable. > > What we currently test is some Avenger96-Board with 1 GiB of RAM > running some Yocto-Linux, but it already seems that this doesn't > fit to a battery-powered mode. So some far less powerful hardware > with e.g. only 128 MiB of RAM gets considered as well. > > https://www.96boards.org/product/avenger96/ > > The AV96 with 1 GiB of RAM runs my tested server-software pretty > fine, but fails with 128 MiB. With some easy steps the image could > be changed to make ~60 MiB of RAM free for my usage, but that > simply wasn't enough to start my web-app at all. Tomcat itself ran > fine even with only 15 MiB of RAM free, though, unless used with my > app. :-) > > What I would like to get a feeling for is if that approach is even > worth following or not. So thanks for everything you share! > > Mit freundlichen Grüßen, > > Thorsten Schöning > [1] https://www.phoronix.com/scan.php?page=news_item&px=Linux-Does-Bad-Low-R AM -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl2om0UACgkQHPApP6U8 pFiiLxAAsdF7vqSg0dItHkgZGwZpHuKzHhrlXcqGtVGGS+pEEiKy5cWi2sa1ku5G Zu/qv+m/C83zyDCKC0UXU42OpvTIqOlcHJxCim8oGQmKcA/RkWgzj5VS+oXy4uYG 6FBYizwqyE9+8Dr1AxQ+bMxIv15Q5B9exoNF5sfuq1CtFIHuLRiNkNkfS2afqZkP /SLAVfamU2HWHH64Vv3QuvVMq/ujFXOyKhaBRYcazYeYIu1mPgHKrNDCoOo6V8ni MKsqx1SizrGvEtFoyRyLQYdoVBp4ETXTpvWRLbQOal46/tN6a19FslZ66ssBjZng K1hsUX+tIw8CkLGvax4viMe4fmTCTVV99PvfV5n/uXM/3tYs+fcixGvx4affAfYL xXgwEtU3eYnloX/OsMyNhxt4zfck2mnaIQZgYEthEn5BDvQDhCBAeWFVUTx2QzmN yOPlOgzqMoxQUGNKEGeLpcbxLhjtDuAwQivrwASPHaIy2YDiefme8+Oj5wlD3ifj vz8eJU1E87BazNXgiuD4Re1elfwnRTnaozIf6P2lMo0NvZ9AB4R0cb1MWeZNuk9X bhEi50X8yN634uQBdSrDNY7kWPCQavylRPEDYQTPmgAzj/sONQHknsc+03wpkwW6 cLj5Y6WTCSqZJY3IOatUT+I6uCggJyoEsPkEivn+PJs8UiF8r8U= =br6L -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org