Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
December 2016
- 78 participants
- 402 messages
Re: [Pharo-users] real world pharo web application set ups
by Volkert
come on, i am only interested in what set up Pharo is currently used (as
mentioned in my initial question).
This gives me a feeling, if my requirements are nearby the requirement
found in current pharo
based systems ... if i am complete out of population of current pharo
systems, this is for me a good
indication to bet not on it ...
On 16.12.2016 10:41, Norbert Hartl wrote:
> I'm still not sure about what we are talking. There are some many opinions regarding totally different things.
>
> These benchmark don't say much. As Sven and you did the benchmark on different machines they are hard to compare in numbers. It is not that important because you can not make many conclusions from a micro benchmark. So what Sven has proven is the fact that there is no limit for pharo per se to handle 1k requests per second and more.
>
> From these 1k req/s to Joachims 5 reqs/s is big difference. You can always assume there is something blocking the vm or a synchron I/O call takes a lot of time. But it is not helpful either because that is an edge case like Svens test with an app that does nothing. I would even state that it is not that easy to produce a situation like Joachim describes. If you have that kind of a problem than I'm pretty sure the reasons are mostly not pharo related. Sure if it comes to blocking I/O then it is pharo's fault because it cannot do async I/O, yet. But a slow database query is not the fault of pharo and you will experience the exact same thing in any other runtime.
>
> Whatever it will be there is no other way then to measure your exact use case and find the bottlenecks that prevent your app from being able to handle 1000 concurrent requests. While I agree with a lot of points mentioned in this thread I cannot share the general notion of saying that you reduce the number of requests per image and "just" use more images and more machines. That is not true.
> The moment you cannot deal with all your requests in a single image you are in trouble. As soon as there is a second image you need to make sure there is no volatile shared state between those images. You need to take caution then. Scaling up using more images and more machines shifts problem to the database because it is a central component that is not easy to scale. But again it is not pharo's fault either.
>
> So I would state two things:
>
> - We are talking about really high numbers of requests/s. The odds you are getting in this kind of scaling trouble are usually close to zero. It means you need to generate an application that has really many users. Most projects we know end up using a single image for everything.
> - Whenever you have performance problems in your application architecture I'm pretty sure pharo is not in the top of the list of bottlenecks.
>
> So yes, you can handle pretty huge numbers using pharo.
>
> Norbert
>
>> Am 16.12.2016 um 09:57 schrieb volkert <volkert(a)nivoba.de>:
>>
>> Sven,
>>
>> compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @ 3.20GHz à 4, on linux ...
>>
>> Conncurrent request: 8
>>
>> $ ab -k -c 8 -n 10240 http://127.0.0.1:8080/
>> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software:
>> Server Hostname: 127.0.0.1
>> Server Port: 8080
>>
>> Document Path: /
>> Document Length: 7734 bytes
>>
>> Concurrency Level: 8
>> Time taken for tests: 0.192 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10143
>> Total transferred: 80658152 bytes
>> HTML transferred: 79196160 bytes
>> Requests per second: 53414.29 [#/sec] (mean)
>> Time per request: 0.150 [ms] (mean)
>> Time per request: 0.019 [ms] (mean, across all concurrent requests)
>> Transfer rate: 410871.30 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 0 0.0 0 0
>> Processing: 0 0 0.2 0 3
>> Waiting: 0 0 0.2 0 3
>> Total: 0 0 0.2 0 3
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 0
>> 66% 0
>> 75% 0
>> 80% 0
>> 90% 0
>> 95% 1
>> 98% 1
>> 99% 1
>> 100% 3 (longest request)
>>
>>
>> And here with 1000 concurrent request ...
>>
>> $ab -k -c 1000 -n 10240 http://127.0.0.1:8080/
>> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software:
>> Server Hostname: 127.0.0.1
>> Server Port: 8080
>>
>> Document Path: /
>> Document Length: 7734 bytes
>>
>> Concurrency Level: 1000
>> Time taken for tests: 0.225 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10232
>> Total transferred: 80660288 bytes
>> HTML transferred: 79196160 bytes
>> Requests per second: 45583.23 [#/sec] (mean)
>> Time per request: 21.938 [ms] (mean)
>> Time per request: 0.022 [ms] (mean, across all concurrent requests)
>> Transfer rate: 350642.85 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 1 3.3 0 23
>> Processing: 0 6 16.1 0 198
>> Waiting: 0 6 16.1 0 198
>> Total: 0 7 18.0 0 211
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 0
>> 66% 2
>> 75% 6
>> 80% 10
>> 90% 21
>> 95% 32
>> 98% 47
>> 99% 108
>> 100% 211 (longest request)
>>
>>
>>
>> Am 15.12.2016 um 15:00 schrieb Sven Van Caekenberghe:
>>> Joachim,
>>>
>>>> On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
>>>>
>>>> Victor,
>>>>
>>>> Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
>>>>> If I tell you that my current estimate is that a Smalltalk image with Seaside will not be able to handle more than 20 concurrent users, in many cases even less.
>>>>>
>>>>> Seriously? That is kinda a low number, I would expect more for each image. Certainly it depends much on many things, but it is certainly very low for a rough estimate, why you say that?
>>>> seriously, I think 20 is very optimistic for several reasons.
>>>>
>>>> One, you want to be fast and responsive for every single user, so there is absolutely no point in going too close to any limit. It's easy to lose users by providing bad experience.
>>>>
>>>> Second, in a CRUD Application, you mostly work a lot with DB queries. And you connect to all kinds of stuff and do I/O. Some of these things simply block the VM. Even if that is only for 0.3 seconds, you postpone processing for each "unaffected" user by these 0.3 seconds, so this adds to significant delays in response time. And if you do some heavy db operations, 0.3 seconds is not a terribly bad estimate. Add to that the materialization and stuff within the Smalltalk image.
>>>>
>>>> Seaside adapters usually start off green threads for each request. But there are things that need to be serialized (like in a critical Block). So in reality, users block each other way more often than you'd like.
>>>>
>>>> So if you asked me to give a more realistic estimation, I'd correct myself down to a number between 5 and probably a maximum of 10 users. Everything else means you must use all those fancy tricks and tools people mention in this thread.
>>>> So what you absolutely need to do is start with an estimate of 5 concurrent users per image and look for ways to distribute work among servers/images so that these blocking situations are down to a minimum. If you find your software works much better, congratulate yourself and stack up new machines more slowly than initially estimated.
>>>>
>>>>
>>>> Before you turn around and say: Smalltalk is unsuitable for the web, let's take a brief look at what concurrent users really means. Concurrent users are users that request some processing from the server at they very same time (maybe within an interval of 200-400msec). This is not the same as 5 people being currently logged on to the server and requesting something sometimes. 5 concurrent users can be 20, 50, 100 users who are logged in at the same time.
>>>>
>>>> Then there is this sad "share all vs. share nothing" argument. In Seaside you keep all your objects alive (read from db and materialized) between web requests. IN share nothing, you read everything back from disc/db whenever a request comes in. This also takes time and ressources (and pssibly blocks the server for the blink of an eye or two). You exchange RAM with CPU cycles and I/O. It is extremely hard to predict what works better, and I guess nobody ever made A/B tests. It's all just theoretical bla bla and guesses of what definitely must be better in one's world.
>>>>
>>>> Why do I come up with this share everything stuff? Because it usually means that each user that is logged on holds onto a load of objects on the server side (session storage), like their user account, shopping card, settings, last purchases, account information and whatnot. That's easily a list of a few thousand objects (and be it only Proxies) that take up space and want to be inspected by the garbage collector. So each connected user not only needs CPU cycles whenever they send a request to the server, but also uses RAM. In our case, this can easily be 5-10 MB of objects per user. Add to that the shadow copies that your persistence mechanism needs for undo and stuff, and all the data Seaside needs for Continuations etc, and each logged on users needs 15, 20 or more MB of object space. Connect ten users and you have 150-200 MB. That is not a problem per se, but also means there is some hard limit, especially in a 32 bit world. You don't want your server to slow down because it cannot allocate new memory or can't find contiguous slots for stuff and GCs all the time.
>>>>
>>>> To sum up, I think the number of influencing factors is way too high to really give a good estimate. Our experience (based on our mix of computation and I/O) says that 5 concurrent users per image is doable without negative impact on other users. Some operations take so much time that you really need to move them out of the front-facing image and distribute work to backend servers. More than 5 is probably possible but chances are that there are operations that will affect all users and with every additional user there is a growing chance that you have 2 or more requesting the yery same operation within a very short interval. This will make things worse and worse.
>>>>
>>>> So I trust in you guys having lots of cool tools around and knowing loads of tricks to wrench out much more power of a single Smalltalk image, but you also need to take a look at your productivity and speed in creating new features and fixing bugs. Sometimes throwing hardware at a problem like growth and starting with a clever architecture to scale on multiple layers is just the perfect thing to do. To me, handling 7 instead of 5 concurrent users is not such a big win as long as we are not in a posotion where we have so many users that this really matters. For sites like Amazon, Google, Facebook etc. saving 40% in server cost by optimizing the software (investing a few man years) is significant. I hope we'll soon change our mind about this question ;-)
>>>>
>>>> So load balancing and services outsourced to backend servers are key to scalability. This, btw, is not smalltalk specific (some people seem to think you won't get these problems in Java or Ruby because they are made for the web...).
>>>>
>>>> Joachim
>>> Everything you say, all your considerations, especially the last paragraph is/are correct and I agree.
>>>
>>> But some people will only remember the very low number you seem to be suggesting (which is more of a worse case scenario, with Seaside+blocking/slow connections to back end systems).
>>>
>>> One the other hand, plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.
>>>
>>>
>>> $ pharo Pharo.image printVersion
>>> [version] 4.0 #40626
>>>
>>> $ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
>>>
>>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
>>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>>
>>> Benchmarking 127.0.0.1 (be patient)
>>> Completed 1024 requests
>>> Completed 2048 requests
>>> Completed 3072 requests
>>> Completed 4096 requests
>>> Completed 5120 requests
>>> Completed 6144 requests
>>> Completed 7168 requests
>>> Completed 8192 requests
>>> Completed 9216 requests
>>> Completed 10240 requests
>>> Finished 10240 requests
>>>
>>>
>>> Server Software: Zinc
>>> Server Hostname: 127.0.0.1
>>> Server Port: 1701
>>>
>>> Document Path: /bytes/32
>>> Document Length: 32 bytes
>>>
>>> Concurrency Level: 8
>>> Time taken for tests: 1.945 seconds
>>> Complete requests: 10240
>>> Failed requests: 0
>>> Keep-Alive requests: 10240
>>> Total transferred: 2109440 bytes
>>> HTML transferred: 327680 bytes
>>> Requests per second: 5265.17 [#/sec] (mean)
>>> Time per request: 1.519 [ms] (mean)
>>> Time per request: 0.190 [ms] (mean, across all concurrent requests)
>>> Transfer rate: 1059.20 [Kbytes/sec] received
>>>
>>> Connection Times (ms)
>>> min mean[+/-sd] median max
>>> Connect: 0 0 0.0 0 2
>>> Processing: 0 2 8.0 2 309
>>> Waiting: 0 1 8.0 1 309
>>> Total: 0 2 8.0 2 309
>>>
>>> Percentage of the requests served within a certain time (ms)
>>> 50% 2
>>> 66% 2
>>> 75% 2
>>> 80% 2
>>> 90% 2
>>> 95% 3
>>> 98% 3
>>> 99% 3
>>> 100% 309 (longest request)
>>>
>>>
>>> More than 5K req/s (10K requests, 8 concurrent clients).
>>>
>>> Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.
>>>
>>> A more realistic payload (7K HTML) gives the following:
>>>
>>>
>>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
>>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>>
>>> Benchmarking 127.0.0.1 (be patient)
>>> Completed 1024 requests
>>> Completed 2048 requests
>>> Completed 3072 requests
>>> Completed 4096 requests
>>> Completed 5120 requests
>>> Completed 6144 requests
>>> Completed 7168 requests
>>> Completed 8192 requests
>>> Completed 9216 requests
>>> Completed 10240 requests
>>> Finished 10240 requests
>>>
>>>
>>> Server Software: Zinc
>>> Server Hostname: 127.0.0.1
>>> Server Port: 1701
>>>
>>> Document Path: /dw-bench
>>> Document Length: 7734 bytes
>>>
>>> Concurrency Level: 8
>>> Time taken for tests: 7.874 seconds
>>> Complete requests: 10240
>>> Failed requests: 0
>>> Keep-Alive requests: 10240
>>> Total transferred: 80988160 bytes
>>> HTML transferred: 79196160 bytes
>>> Requests per second: 1300.46 [#/sec] (mean)
>>> Time per request: 6.152 [ms] (mean)
>>> Time per request: 0.769 [ms] (mean, across all concurrent requests)
>>> Transfer rate: 10044.25 [Kbytes/sec] received
>>>
>>> Connection Times (ms)
>>> min mean[+/-sd] median max
>>> Connect: 0 0 0.0 0 0
>>> Processing: 1 6 183.4 1 7874
>>> Waiting: 1 6 183.4 1 7874
>>> Total: 1 6 183.4 1 7874
>>>
>>> Percentage of the requests served within a certain time (ms)
>>> 50% 1
>>> 66% 1
>>> 75% 1
>>> 80% 1
>>> 90% 1
>>> 95% 1
>>> 98% 1
>>> 99% 1
>>> 100% 7874 (longest request)
>>>
>>>
>>> That is more than 1K req/s.
>>>
>>> In both cases we are talking about sub 1ms req/resp cycles !
>>>
>>> I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.
>>>
>>> Sven
>>>
>>>
>>>
>>
>>
>
Dec. 16, 2016
Re: [Pharo-users] real world pharo web application set ups
by Norbert Hartl
I'm still not sure about what we are talking. There are some many opinions regarding totally different things.
These benchmark don't say much. As Sven and you did the benchmark on different machines they are hard to compare in numbers. It is not that important because you can not make many conclusions from a micro benchmark. So what Sven has proven is the fact that there is no limit for pharo per se to handle 1k requests per second and more.
From these 1k req/s to Joachims 5 reqs/s is big difference. You can always assume there is something blocking the vm or a synchron I/O call takes a lot of time. But it is not helpful either because that is an edge case like Svens test with an app that does nothing. I would even state that it is not that easy to produce a situation like Joachim describes. If you have that kind of a problem than I'm pretty sure the reasons are mostly not pharo related. Sure if it comes to blocking I/O then it is pharo's fault because it cannot do async I/O, yet. But a slow database query is not the fault of pharo and you will experience the exact same thing in any other runtime.
Whatever it will be there is no other way then to measure your exact use case and find the bottlenecks that prevent your app from being able to handle 1000 concurrent requests. While I agree with a lot of points mentioned in this thread I cannot share the general notion of saying that you reduce the number of requests per image and "just" use more images and more machines. That is not true.
The moment you cannot deal with all your requests in a single image you are in trouble. As soon as there is a second image you need to make sure there is no volatile shared state between those images. You need to take caution then. Scaling up using more images and more machines shifts problem to the database because it is a central component that is not easy to scale. But again it is not pharo's fault either.
So I would state two things:
- We are talking about really high numbers of requests/s. The odds you are getting in this kind of scaling trouble are usually close to zero. It means you need to generate an application that has really many users. Most projects we know end up using a single image for everything.
- Whenever you have performance problems in your application architecture I'm pretty sure pharo is not in the top of the list of bottlenecks.
So yes, you can handle pretty huge numbers using pharo.
Norbert
> Am 16.12.2016 um 09:57 schrieb volkert <volkert(a)nivoba.de>:
>
> Sven,
>
> compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @ 3.20GHz à 4, on linux ...
>
> Conncurrent request: 8
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software:
> Server Hostname: 127.0.0.1
> Server Port: 8080
>
> Document Path: /
> Document Length: 7734 bytes
>
> Concurrency Level: 8
> Time taken for tests: 0.192 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10143
> Total transferred: 80658152 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 53414.29 [#/sec] (mean)
> Time per request: 0.150 [ms] (mean)
> Time per request: 0.019 [ms] (mean, across all concurrent requests)
> Transfer rate: 410871.30 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 0
> Processing: 0 0 0.2 0 3
> Waiting: 0 0 0.2 0 3
> Total: 0 0 0.2 0 3
>
> Percentage of the requests served within a certain time (ms)
> 50% 0
> 66% 0
> 75% 0
> 80% 0
> 90% 0
> 95% 1
> 98% 1
> 99% 1
> 100% 3 (longest request)
>
>
> And here with 1000 concurrent request ...
>
> $ab -k -c 1000 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software:
> Server Hostname: 127.0.0.1
> Server Port: 8080
>
> Document Path: /
> Document Length: 7734 bytes
>
> Concurrency Level: 1000
> Time taken for tests: 0.225 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10232
> Total transferred: 80660288 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 45583.23 [#/sec] (mean)
> Time per request: 21.938 [ms] (mean)
> Time per request: 0.022 [ms] (mean, across all concurrent requests)
> Transfer rate: 350642.85 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 1 3.3 0 23
> Processing: 0 6 16.1 0 198
> Waiting: 0 6 16.1 0 198
> Total: 0 7 18.0 0 211
>
> Percentage of the requests served within a certain time (ms)
> 50% 0
> 66% 2
> 75% 6
> 80% 10
> 90% 21
> 95% 32
> 98% 47
> 99% 108
> 100% 211 (longest request)
>
>
>
> Am 15.12.2016 um 15:00 schrieb Sven Van Caekenberghe:
>> Joachim,
>>
>>> On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
>>>
>>> Victor,
>>>
>>> Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
>>>> If I tell you that my current estimate is that a Smalltalk image with Seaside will not be able to handle more than 20 concurrent users, in many cases even less.
>>>>
>>>> Seriously? That is kinda a low number, I would expect more for each image. Certainly it depends much on many things, but it is certainly very low for a rough estimate, why you say that?
>>> seriously, I think 20 is very optimistic for several reasons.
>>>
>>> One, you want to be fast and responsive for every single user, so there is absolutely no point in going too close to any limit. It's easy to lose users by providing bad experience.
>>>
>>> Second, in a CRUD Application, you mostly work a lot with DB queries. And you connect to all kinds of stuff and do I/O. Some of these things simply block the VM. Even if that is only for 0.3 seconds, you postpone processing for each "unaffected" user by these 0.3 seconds, so this adds to significant delays in response time. And if you do some heavy db operations, 0.3 seconds is not a terribly bad estimate. Add to that the materialization and stuff within the Smalltalk image.
>>>
>>> Seaside adapters usually start off green threads for each request. But there are things that need to be serialized (like in a critical Block). So in reality, users block each other way more often than you'd like.
>>>
>>> So if you asked me to give a more realistic estimation, I'd correct myself down to a number between 5 and probably a maximum of 10 users. Everything else means you must use all those fancy tricks and tools people mention in this thread.
>>> So what you absolutely need to do is start with an estimate of 5 concurrent users per image and look for ways to distribute work among servers/images so that these blocking situations are down to a minimum. If you find your software works much better, congratulate yourself and stack up new machines more slowly than initially estimated.
>>>
>>>
>>> Before you turn around and say: Smalltalk is unsuitable for the web, let's take a brief look at what concurrent users really means. Concurrent users are users that request some processing from the server at they very same time (maybe within an interval of 200-400msec). This is not the same as 5 people being currently logged on to the server and requesting something sometimes. 5 concurrent users can be 20, 50, 100 users who are logged in at the same time.
>>>
>>> Then there is this sad "share all vs. share nothing" argument. In Seaside you keep all your objects alive (read from db and materialized) between web requests. IN share nothing, you read everything back from disc/db whenever a request comes in. This also takes time and ressources (and pssibly blocks the server for the blink of an eye or two). You exchange RAM with CPU cycles and I/O. It is extremely hard to predict what works better, and I guess nobody ever made A/B tests. It's all just theoretical bla bla and guesses of what definitely must be better in one's world.
>>>
>>> Why do I come up with this share everything stuff? Because it usually means that each user that is logged on holds onto a load of objects on the server side (session storage), like their user account, shopping card, settings, last purchases, account information and whatnot. That's easily a list of a few thousand objects (and be it only Proxies) that take up space and want to be inspected by the garbage collector. So each connected user not only needs CPU cycles whenever they send a request to the server, but also uses RAM. In our case, this can easily be 5-10 MB of objects per user. Add to that the shadow copies that your persistence mechanism needs for undo and stuff, and all the data Seaside needs for Continuations etc, and each logged on users needs 15, 20 or more MB of object space. Connect ten users and you have 150-200 MB. That is not a problem per se, but also means there is some hard limit, especially in a 32 bit world. You don't want your server to slow down because it cannot allocate new memory or can't find contiguous slots for stuff and GCs all the time.
>>>
>>> To sum up, I think the number of influencing factors is way too high to really give a good estimate. Our experience (based on our mix of computation and I/O) says that 5 concurrent users per image is doable without negative impact on other users. Some operations take so much time that you really need to move them out of the front-facing image and distribute work to backend servers. More than 5 is probably possible but chances are that there are operations that will affect all users and with every additional user there is a growing chance that you have 2 or more requesting the yery same operation within a very short interval. This will make things worse and worse.
>>>
>>> So I trust in you guys having lots of cool tools around and knowing loads of tricks to wrench out much more power of a single Smalltalk image, but you also need to take a look at your productivity and speed in creating new features and fixing bugs. Sometimes throwing hardware at a problem like growth and starting with a clever architecture to scale on multiple layers is just the perfect thing to do. To me, handling 7 instead of 5 concurrent users is not such a big win as long as we are not in a posotion where we have so many users that this really matters. For sites like Amazon, Google, Facebook etc. saving 40% in server cost by optimizing the software (investing a few man years) is significant. I hope we'll soon change our mind about this question ;-)
>>>
>>> So load balancing and services outsourced to backend servers are key to scalability. This, btw, is not smalltalk specific (some people seem to think you won't get these problems in Java or Ruby because they are made for the web...).
>>>
>>> Joachim
>> Everything you say, all your considerations, especially the last paragraph is/are correct and I agree.
>>
>> But some people will only remember the very low number you seem to be suggesting (which is more of a worse case scenario, with Seaside+blocking/slow connections to back end systems).
>>
>> One the other hand, plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.
>>
>>
>> $ pharo Pharo.image printVersion
>> [version] 4.0 #40626
>>
>> $ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
>>
>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software: Zinc
>> Server Hostname: 127.0.0.1
>> Server Port: 1701
>>
>> Document Path: /bytes/32
>> Document Length: 32 bytes
>>
>> Concurrency Level: 8
>> Time taken for tests: 1.945 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10240
>> Total transferred: 2109440 bytes
>> HTML transferred: 327680 bytes
>> Requests per second: 5265.17 [#/sec] (mean)
>> Time per request: 1.519 [ms] (mean)
>> Time per request: 0.190 [ms] (mean, across all concurrent requests)
>> Transfer rate: 1059.20 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 0 0.0 0 2
>> Processing: 0 2 8.0 2 309
>> Waiting: 0 1 8.0 1 309
>> Total: 0 2 8.0 2 309
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 2
>> 66% 2
>> 75% 2
>> 80% 2
>> 90% 2
>> 95% 3
>> 98% 3
>> 99% 3
>> 100% 309 (longest request)
>>
>>
>> More than 5K req/s (10K requests, 8 concurrent clients).
>>
>> Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.
>>
>> A more realistic payload (7K HTML) gives the following:
>>
>>
>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software: Zinc
>> Server Hostname: 127.0.0.1
>> Server Port: 1701
>>
>> Document Path: /dw-bench
>> Document Length: 7734 bytes
>>
>> Concurrency Level: 8
>> Time taken for tests: 7.874 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10240
>> Total transferred: 80988160 bytes
>> HTML transferred: 79196160 bytes
>> Requests per second: 1300.46 [#/sec] (mean)
>> Time per request: 6.152 [ms] (mean)
>> Time per request: 0.769 [ms] (mean, across all concurrent requests)
>> Transfer rate: 10044.25 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 0 0.0 0 0
>> Processing: 1 6 183.4 1 7874
>> Waiting: 1 6 183.4 1 7874
>> Total: 1 6 183.4 1 7874
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 1
>> 66% 1
>> 75% 1
>> 80% 1
>> 90% 1
>> 95% 1
>> 98% 1
>> 99% 1
>> 100% 7874 (longest request)
>>
>>
>> That is more than 1K req/s.
>>
>> In both cases we are talking about sub 1ms req/resp cycles !
>>
>> I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.
>>
>> Sven
>>
>>
>>
>
>
>
Dec. 16, 2016
Re: [Pharo-users] real world pharo web application set ups
by jtuchel@objektfabrik.de
Sven,
Am 16.12.16 um 10:05 schrieb Sven Van Caekenberghe:
> I did not say we are the fastest, for from it. I absolutely do not want to go into a contest, there is no point in doing so.
Absolutely right.
>
> (The dw-bench page was meant to be generated dynamically on each request without caching, did you do that too ?).
>
> My point was: Pharo is good enough for most web applications. The rest of the challenge is standard software architecture, design and development. I choose to do that in Pharo because I like it so much. It is perfectly fine by me that 99.xx % of the world makes other decisions, for whatever reason.
Exactly. Smalltalk and Seaside are perfectly suited for web applications
and are not per se extremely slow or anything.
Raw benchmarks are some indicator, but whether a web applicaton is fast
or slow depends so much more on your applications' architecture than the
underlying HTTP handling stuff.
The important question is not "how fast can Smalltalk serve a number of
bytes?" but "how fast can your application do whatever is needed to put
those bytes together?".
So your benchmarks show that Smalltalk can serve stuff more than fast
enough for amost all situations (let's be honest, most of us will never
have to server thousands of concurrent users - of course I hope I am
wrong ;-) ). The rest is application architecture, infrastructure and
avoiding stupid errors. Nothing Smalltalk specific.
Joachim
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
Dec. 16, 2016
Re: [Pharo-users] real world pharo web application set ups
by Sven Van Caekenberghe
I did not say we are the fastest, for from it. I absolutely do not want to go into a contest, there is no point in doing so.
(The dw-bench page was meant to be generated dynamically on each request without caching, did you do that too ?).
My point was: Pharo is good enough for most web applications. The rest of the challenge is standard software architecture, design and development. I choose to do that in Pharo because I like it so much. It is perfectly fine by me that 99.xx % of the world makes other decisions, for whatever reason.
> On 16 Dec 2016, at 09:57, volkert <volkert(a)nivoba.de> wrote:
>
> Sven,
>
> compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @ 3.20GHz à 4, on linux ...
>
> Conncurrent request: 8
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software:
> Server Hostname: 127.0.0.1
> Server Port: 8080
>
> Document Path: /
> Document Length: 7734 bytes
>
> Concurrency Level: 8
> Time taken for tests: 0.192 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10143
> Total transferred: 80658152 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 53414.29 [#/sec] (mean)
> Time per request: 0.150 [ms] (mean)
> Time per request: 0.019 [ms] (mean, across all concurrent requests)
> Transfer rate: 410871.30 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 0
> Processing: 0 0 0.2 0 3
> Waiting: 0 0 0.2 0 3
> Total: 0 0 0.2 0 3
>
> Percentage of the requests served within a certain time (ms)
> 50% 0
> 66% 0
> 75% 0
> 80% 0
> 90% 0
> 95% 1
> 98% 1
> 99% 1
> 100% 3 (longest request)
>
>
> And here with 1000 concurrent request ...
>
> $ab -k -c 1000 -n 10240 http://127.0.0.1:8080/
> This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software:
> Server Hostname: 127.0.0.1
> Server Port: 8080
>
> Document Path: /
> Document Length: 7734 bytes
>
> Concurrency Level: 1000
> Time taken for tests: 0.225 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10232
> Total transferred: 80660288 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 45583.23 [#/sec] (mean)
> Time per request: 21.938 [ms] (mean)
> Time per request: 0.022 [ms] (mean, across all concurrent requests)
> Transfer rate: 350642.85 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 1 3.3 0 23
> Processing: 0 6 16.1 0 198
> Waiting: 0 6 16.1 0 198
> Total: 0 7 18.0 0 211
>
> Percentage of the requests served within a certain time (ms)
> 50% 0
> 66% 2
> 75% 6
> 80% 10
> 90% 21
> 95% 32
> 98% 47
> 99% 108
> 100% 211 (longest request)
>
>
>
> Am 15.12.2016 um 15:00 schrieb Sven Van Caekenberghe:
>> Joachim,
>>
>>> On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
>>>
>>> Victor,
>>>
>>> Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
>>>> If I tell you that my current estimate is that a Smalltalk image with Seaside will not be able to handle more than 20 concurrent users, in many cases even less.
>>>>
>>>> Seriously? That is kinda a low number, I would expect more for each image. Certainly it depends much on many things, but it is certainly very low for a rough estimate, why you say that?
>>> seriously, I think 20 is very optimistic for several reasons.
>>>
>>> One, you want to be fast and responsive for every single user, so there is absolutely no point in going too close to any limit. It's easy to lose users by providing bad experience.
>>>
>>> Second, in a CRUD Application, you mostly work a lot with DB queries. And you connect to all kinds of stuff and do I/O. Some of these things simply block the VM. Even if that is only for 0.3 seconds, you postpone processing for each "unaffected" user by these 0.3 seconds, so this adds to significant delays in response time. And if you do some heavy db operations, 0.3 seconds is not a terribly bad estimate. Add to that the materialization and stuff within the Smalltalk image.
>>>
>>> Seaside adapters usually start off green threads for each request. But there are things that need to be serialized (like in a critical Block). So in reality, users block each other way more often than you'd like.
>>>
>>> So if you asked me to give a more realistic estimation, I'd correct myself down to a number between 5 and probably a maximum of 10 users. Everything else means you must use all those fancy tricks and tools people mention in this thread.
>>> So what you absolutely need to do is start with an estimate of 5 concurrent users per image and look for ways to distribute work among servers/images so that these blocking situations are down to a minimum. If you find your software works much better, congratulate yourself and stack up new machines more slowly than initially estimated.
>>>
>>>
>>> Before you turn around and say: Smalltalk is unsuitable for the web, let's take a brief look at what concurrent users really means. Concurrent users are users that request some processing from the server at they very same time (maybe within an interval of 200-400msec). This is not the same as 5 people being currently logged on to the server and requesting something sometimes. 5 concurrent users can be 20, 50, 100 users who are logged in at the same time.
>>>
>>> Then there is this sad "share all vs. share nothing" argument. In Seaside you keep all your objects alive (read from db and materialized) between web requests. IN share nothing, you read everything back from disc/db whenever a request comes in. This also takes time and ressources (and pssibly blocks the server for the blink of an eye or two). You exchange RAM with CPU cycles and I/O. It is extremely hard to predict what works better, and I guess nobody ever made A/B tests. It's all just theoretical bla bla and guesses of what definitely must be better in one's world.
>>>
>>> Why do I come up with this share everything stuff? Because it usually means that each user that is logged on holds onto a load of objects on the server side (session storage), like their user account, shopping card, settings, last purchases, account information and whatnot. That's easily a list of a few thousand objects (and be it only Proxies) that take up space and want to be inspected by the garbage collector. So each connected user not only needs CPU cycles whenever they send a request to the server, but also uses RAM. In our case, this can easily be 5-10 MB of objects per user. Add to that the shadow copies that your persistence mechanism needs for undo and stuff, and all the data Seaside needs for Continuations etc, and each logged on users needs 15, 20 or more MB of object space. Connect ten users and you have 150-200 MB. That is not a problem per se, but also means there is some hard limit, especially in a 32 bit world. You don't want your server to slow down because it cannot allocate new memory or can't find contiguous slots for stuff and GCs all the time.
>>>
>>> To sum up, I think the number of influencing factors is way too high to really give a good estimate. Our experience (based on our mix of computation and I/O) says that 5 concurrent users per image is doable without negative impact on other users. Some operations take so much time that you really need to move them out of the front-facing image and distribute work to backend servers. More than 5 is probably possible but chances are that there are operations that will affect all users and with every additional user there is a growing chance that you have 2 or more requesting the yery same operation within a very short interval. This will make things worse and worse.
>>>
>>> So I trust in you guys having lots of cool tools around and knowing loads of tricks to wrench out much more power of a single Smalltalk image, but you also need to take a look at your productivity and speed in creating new features and fixing bugs. Sometimes throwing hardware at a problem like growth and starting with a clever architecture to scale on multiple layers is just the perfect thing to do. To me, handling 7 instead of 5 concurrent users is not such a big win as long as we are not in a posotion where we have so many users that this really matters. For sites like Amazon, Google, Facebook etc. saving 40% in server cost by optimizing the software (investing a few man years) is significant. I hope we'll soon change our mind about this question ;-)
>>>
>>> So load balancing and services outsourced to backend servers are key to scalability. This, btw, is not smalltalk specific (some people seem to think you won't get these problems in Java or Ruby because they are made for the web...).
>>>
>>> Joachim
>> Everything you say, all your considerations, especially the last paragraph is/are correct and I agree.
>>
>> But some people will only remember the very low number you seem to be suggesting (which is more of a worse case scenario, with Seaside+blocking/slow connections to back end systems).
>>
>> One the other hand, plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.
>>
>>
>> $ pharo Pharo.image printVersion
>> [version] 4.0 #40626
>>
>> $ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
>>
>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software: Zinc
>> Server Hostname: 127.0.0.1
>> Server Port: 1701
>>
>> Document Path: /bytes/32
>> Document Length: 32 bytes
>>
>> Concurrency Level: 8
>> Time taken for tests: 1.945 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10240
>> Total transferred: 2109440 bytes
>> HTML transferred: 327680 bytes
>> Requests per second: 5265.17 [#/sec] (mean)
>> Time per request: 1.519 [ms] (mean)
>> Time per request: 0.190 [ms] (mean, across all concurrent requests)
>> Transfer rate: 1059.20 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 0 0.0 0 2
>> Processing: 0 2 8.0 2 309
>> Waiting: 0 1 8.0 1 309
>> Total: 0 2 8.0 2 309
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 2
>> 66% 2
>> 75% 2
>> 80% 2
>> 90% 2
>> 95% 3
>> 98% 3
>> 99% 3
>> 100% 309 (longest request)
>>
>>
>> More than 5K req/s (10K requests, 8 concurrent clients).
>>
>> Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.
>>
>> A more realistic payload (7K HTML) gives the following:
>>
>>
>> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
>> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
>> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
>> Licensed to The Apache Software Foundation, http://www.apache.org/
>>
>> Benchmarking 127.0.0.1 (be patient)
>> Completed 1024 requests
>> Completed 2048 requests
>> Completed 3072 requests
>> Completed 4096 requests
>> Completed 5120 requests
>> Completed 6144 requests
>> Completed 7168 requests
>> Completed 8192 requests
>> Completed 9216 requests
>> Completed 10240 requests
>> Finished 10240 requests
>>
>>
>> Server Software: Zinc
>> Server Hostname: 127.0.0.1
>> Server Port: 1701
>>
>> Document Path: /dw-bench
>> Document Length: 7734 bytes
>>
>> Concurrency Level: 8
>> Time taken for tests: 7.874 seconds
>> Complete requests: 10240
>> Failed requests: 0
>> Keep-Alive requests: 10240
>> Total transferred: 80988160 bytes
>> HTML transferred: 79196160 bytes
>> Requests per second: 1300.46 [#/sec] (mean)
>> Time per request: 6.152 [ms] (mean)
>> Time per request: 0.769 [ms] (mean, across all concurrent requests)
>> Transfer rate: 10044.25 [Kbytes/sec] received
>>
>> Connection Times (ms)
>> min mean[+/-sd] median max
>> Connect: 0 0 0.0 0 0
>> Processing: 1 6 183.4 1 7874
>> Waiting: 1 6 183.4 1 7874
>> Total: 1 6 183.4 1 7874
>>
>> Percentage of the requests served within a certain time (ms)
>> 50% 1
>> 66% 1
>> 75% 1
>> 80% 1
>> 90% 1
>> 95% 1
>> 98% 1
>> 99% 1
>> 100% 7874 (longest request)
>>
>>
>> That is more than 1K req/s.
>>
>> In both cases we are talking about sub 1ms req/resp cycles !
>>
>> I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.
>>
>> Sven
>>
>>
>>
>
>
>
Dec. 16, 2016
Re: [Pharo-users] real world pharo web application set ups
by volkert
Sven,
compare with an erlang vm (Cowboy) on a standard pc, i5-4570 CPU @
3.20GHz à 4, on linux ...
Conncurrent request: 8
$ ab -k -c 8 -n 10240 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 7734 bytes
Concurrency Level: 8
Time taken for tests: 0.192 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10143
Total transferred: 80658152 bytes
HTML transferred: 79196160 bytes
Requests per second: 53414.29 [#/sec] (mean)
Time per request: 0.150 [ms] (mean)
Time per request: 0.019 [ms] (mean, across all concurrent requests)
Transfer rate: 410871.30 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 0 0 0.2 0 3
Waiting: 0 0 0.2 0 3
Total: 0 0 0.2 0 3
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 1
98% 1
99% 1
100% 3 (longest request)
And here with 1000 concurrent request ...
$ab -k -c 1000 -n 10240 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 7734 bytes
Concurrency Level: 1000
Time taken for tests: 0.225 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10232
Total transferred: 80660288 bytes
HTML transferred: 79196160 bytes
Requests per second: 45583.23 [#/sec] (mean)
Time per request: 21.938 [ms] (mean)
Time per request: 0.022 [ms] (mean, across all concurrent requests)
Transfer rate: 350642.85 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 3.3 0 23
Processing: 0 6 16.1 0 198
Waiting: 0 6 16.1 0 198
Total: 0 7 18.0 0 211
Percentage of the requests served within a certain time (ms)
50% 0
66% 2
75% 6
80% 10
90% 21
95% 32
98% 47
99% 108
100% 211 (longest request)
Am 15.12.2016 um 15:00 schrieb Sven Van Caekenberghe:
> Joachim,
>
>> On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
>>
>> Victor,
>>
>> Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
>>> If I tell you that my current estimate is that a Smalltalk image with Seaside will not be able to handle more than 20 concurrent users, in many cases even less.
>>>
>>> Seriously? That is kinda a low number, I would expect more for each image. Certainly it depends much on many things, but it is certainly very low for a rough estimate, why you say that?
>> seriously, I think 20 is very optimistic for several reasons.
>>
>> One, you want to be fast and responsive for every single user, so there is absolutely no point in going too close to any limit. It's easy to lose users by providing bad experience.
>>
>> Second, in a CRUD Application, you mostly work a lot with DB queries. And you connect to all kinds of stuff and do I/O. Some of these things simply block the VM. Even if that is only for 0.3 seconds, you postpone processing for each "unaffected" user by these 0.3 seconds, so this adds to significant delays in response time. And if you do some heavy db operations, 0.3 seconds is not a terribly bad estimate. Add to that the materialization and stuff within the Smalltalk image.
>>
>> Seaside adapters usually start off green threads for each request. But there are things that need to be serialized (like in a critical Block). So in reality, users block each other way more often than you'd like.
>>
>> So if you asked me to give a more realistic estimation, I'd correct myself down to a number between 5 and probably a maximum of 10 users. Everything else means you must use all those fancy tricks and tools people mention in this thread.
>> So what you absolutely need to do is start with an estimate of 5 concurrent users per image and look for ways to distribute work among servers/images so that these blocking situations are down to a minimum. If you find your software works much better, congratulate yourself and stack up new machines more slowly than initially estimated.
>>
>>
>> Before you turn around and say: Smalltalk is unsuitable for the web, let's take a brief look at what concurrent users really means. Concurrent users are users that request some processing from the server at they very same time (maybe within an interval of 200-400msec). This is not the same as 5 people being currently logged on to the server and requesting something sometimes. 5 concurrent users can be 20, 50, 100 users who are logged in at the same time.
>>
>> Then there is this sad "share all vs. share nothing" argument. In Seaside you keep all your objects alive (read from db and materialized) between web requests. IN share nothing, you read everything back from disc/db whenever a request comes in. This also takes time and ressources (and pssibly blocks the server for the blink of an eye or two). You exchange RAM with CPU cycles and I/O. It is extremely hard to predict what works better, and I guess nobody ever made A/B tests. It's all just theoretical bla bla and guesses of what definitely must be better in one's world.
>>
>> Why do I come up with this share everything stuff? Because it usually means that each user that is logged on holds onto a load of objects on the server side (session storage), like their user account, shopping card, settings, last purchases, account information and whatnot. That's easily a list of a few thousand objects (and be it only Proxies) that take up space and want to be inspected by the garbage collector. So each connected user not only needs CPU cycles whenever they send a request to the server, but also uses RAM. In our case, this can easily be 5-10 MB of objects per user. Add to that the shadow copies that your persistence mechanism needs for undo and stuff, and all the data Seaside needs for Continuations etc, and each logged on users needs 15, 20 or more MB of object space. Connect ten users and you have 150-200 MB. That is not a problem per se, but also means there is some hard limit, especially in a 32 bit world. You don't want your server to slow down because it cannot allocate new memory or can't find contiguous slots for stuff and GCs all the time.
>>
>> To sum up, I think the number of influencing factors is way too high to really give a good estimate. Our experience (based on our mix of computation and I/O) says that 5 concurrent users per image is doable without negative impact on other users. Some operations take so much time that you really need to move them out of the front-facing image and distribute work to backend servers. More than 5 is probably possible but chances are that there are operations that will affect all users and with every additional user there is a growing chance that you have 2 or more requesting the yery same operation within a very short interval. This will make things worse and worse.
>>
>> So I trust in you guys having lots of cool tools around and knowing loads of tricks to wrench out much more power of a single Smalltalk image, but you also need to take a look at your productivity and speed in creating new features and fixing bugs. Sometimes throwing hardware at a problem like growth and starting with a clever architecture to scale on multiple layers is just the perfect thing to do. To me, handling 7 instead of 5 concurrent users is not such a big win as long as we are not in a posotion where we have so many users that this really matters. For sites like Amazon, Google, Facebook etc. saving 40% in server cost by optimizing the software (investing a few man years) is significant. I hope we'll soon change our mind about this question ;-)
>>
>> So load balancing and services outsourced to backend servers are key to scalability. This, btw, is not smalltalk specific (some people seem to think you won't get these problems in Java or Ruby because they are made for the web...).
>>
>> Joachim
> Everything you say, all your considerations, especially the last paragraph is/are correct and I agree.
>
> But some people will only remember the very low number you seem to be suggesting (which is more of a worse case scenario, with Seaside+blocking/slow connections to back end systems).
>
> One the other hand, plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.
>
>
> $ pharo Pharo.image printVersion
> [version] 4.0 #40626
>
> $ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software: Zinc
> Server Hostname: 127.0.0.1
> Server Port: 1701
>
> Document Path: /bytes/32
> Document Length: 32 bytes
>
> Concurrency Level: 8
> Time taken for tests: 1.945 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10240
> Total transferred: 2109440 bytes
> HTML transferred: 327680 bytes
> Requests per second: 5265.17 [#/sec] (mean)
> Time per request: 1.519 [ms] (mean)
> Time per request: 0.190 [ms] (mean, across all concurrent requests)
> Transfer rate: 1059.20 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 2
> Processing: 0 2 8.0 2 309
> Waiting: 0 1 8.0 1 309
> Total: 0 2 8.0 2 309
>
> Percentage of the requests served within a certain time (ms)
> 50% 2
> 66% 2
> 75% 2
> 80% 2
> 90% 2
> 95% 3
> 98% 3
> 99% 3
> 100% 309 (longest request)
>
>
> More than 5K req/s (10K requests, 8 concurrent clients).
>
> Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.
>
> A more realistic payload (7K HTML) gives the following:
>
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software: Zinc
> Server Hostname: 127.0.0.1
> Server Port: 1701
>
> Document Path: /dw-bench
> Document Length: 7734 bytes
>
> Concurrency Level: 8
> Time taken for tests: 7.874 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10240
> Total transferred: 80988160 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 1300.46 [#/sec] (mean)
> Time per request: 6.152 [ms] (mean)
> Time per request: 0.769 [ms] (mean, across all concurrent requests)
> Transfer rate: 10044.25 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 0
> Processing: 1 6 183.4 1 7874
> Waiting: 1 6 183.4 1 7874
> Total: 1 6 183.4 1 7874
>
> Percentage of the requests served within a certain time (ms)
> 50% 1
> 66% 1
> 75% 1
> 80% 1
> 90% 1
> 95% 1
> 98% 1
> 99% 1
> 100% 7874 (longest request)
>
>
> That is more than 1K req/s.
>
> In both cases we are talking about sub 1ms req/resp cycles !
>
> I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.
>
> Sven
>
>
>
Dec. 16, 2016
Re: [Pharo-users] real world pharo web application set ups
by Vitor Medina Cruz
>
> > On 14 Dec 2016, at 23:29, Vitor Medina Cruz <vitormcruz(a)gmail.com>
> wrote:
> >
> > Pharo don't have non-blocking I/O?
> It certainly does at the networking level, but some native code interfaces
> might not act so nice.
Humm, I asked because those times I experimented slow I/O processing and
the image seems to freeze. There are some situations where not even a
cntrl+. can interrupt the work that is freezing it. As I understand, I/O
can be interleaved with other work, but not in all cases because of some
native code that keeps the thread blocked, is that correct? For hi CPU
usage procedures, if it do not explicitly yield execution, then the image
will be blocked until the end of it's execution, right? Also, to take
advantage of multiple cores one must use multiple images or use the CPP library
that Dimitris talked about? Is that another way to spem OS Threads or
process inside an image?
On Wed, Dec 14, 2016 at 8:51 PM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> > On 14 Dec 2016, at 23:29, Vitor Medina Cruz <vitormcruz(a)gmail.com>
> wrote:
> >
> > Pharo don't have non-blocking I/O?
>
> It certainly does at the networking level, but some native code interfaces
> might not act so nice.
>
> > On Wed, Dec 14, 2016 at 6:59 PM, Ramon Leon <ramon.leon(a)allresnet.com>
> wrote:
> > On 12/14/2016 12:09 PM, Esteban A. Maringolo wrote:
> > Can you extend on suspending the UI process? I never did that.
> >
> > I feed my images a start script on the command line
> >
> > pharo-vm-nox \
> > -vm-sound-null -vm-display-null \
> > /var/pharo/app.image \
> > /var/pharo/startScript
> >
> > startScript containing one line (among others) like so...
> >
> > Project uiProcess suspend.
> >
> > I'm on an older Pharo, but I presume the newer ones are the same or
> similar. No sense in wasting CPU on a UI in a headless image
> >
> > Won't the idle use add up?
> >
> > Sure eventually, but you don't run more than a 2 or so per core so
> that'll never be a problem. You shouldn't be running 5 images on a single
> core, let alone more.
> >
> > In my case I served up to 20 concurrent users (out of ~100 total) with
> > only 5 images. Plus another two images for the REST API. In a dual
> > core server.
> >
> > That's barely a server, most laptops these days have more cores. Rent a
> virtual server with a dozen or more cores, then you can run a few images
> per core without the idle mattering at all and run 2 dozen images in total
> per 12 core server.
> >
> > Scale by adding cores and ram allowing you to run more images per box;
> or scale by running more boxes, ultimately, you need to spread out the load
> across many many cores.
> >
> > --
> > Ramon Leon
> >
> >
> >
>
>
>
Dec. 15, 2016
Re: [Pharo-users] real world pharo web application set ups
by Vitor Medina Cruz
Joachim
seriously, I think 20 is very optimistic for several reasons. (...)
Whoa! Thanks for the careful and insightful response, I really appreciate
that! :)
On Thu, Dec 15, 2016 at 12:00 PM, Sven Van Caekenberghe <sven(a)stfx.eu>
wrote:
> Joachim,
>
> > On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
> >
> > Victor,
> >
> > Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
> >> If I tell you that my current estimate is that a Smalltalk image with
> Seaside will not be able to handle more than 20 concurrent users, in many
> cases even less.
> >>
> >> Seriously? That is kinda a low number, I would expect more for each
> image. Certainly it depends much on many things, but it is certainly very
> low for a rough estimate, why you say that?
> >
> > seriously, I think 20 is very optimistic for several reasons.
> >
> > One, you want to be fast and responsive for every single user, so there
> is absolutely no point in going too close to any limit. It's easy to lose
> users by providing bad experience.
> >
> > Second, in a CRUD Application, you mostly work a lot with DB queries.
> And you connect to all kinds of stuff and do I/O. Some of these things
> simply block the VM. Even if that is only for 0.3 seconds, you postpone
> processing for each "unaffected" user by these 0.3 seconds, so this adds to
> significant delays in response time. And if you do some heavy db
> operations, 0.3 seconds is not a terribly bad estimate. Add to that the
> materialization and stuff within the Smalltalk image.
> >
> > Seaside adapters usually start off green threads for each request. But
> there are things that need to be serialized (like in a critical Block). So
> in reality, users block each other way more often than you'd like.
> >
> > So if you asked me to give a more realistic estimation, I'd correct
> myself down to a number between 5 and probably a maximum of 10 users.
> Everything else means you must use all those fancy tricks and tools people
> mention in this thread.
> > So what you absolutely need to do is start with an estimate of 5
> concurrent users per image and look for ways to distribute work among
> servers/images so that these blocking situations are down to a minimum. If
> you find your software works much better, congratulate yourself and stack
> up new machines more slowly than initially estimated.
> >
> >
> > Before you turn around and say: Smalltalk is unsuitable for the web,
> let's take a brief look at what concurrent users really means. Concurrent
> users are users that request some processing from the server at they very
> same time (maybe within an interval of 200-400msec). This is not the same
> as 5 people being currently logged on to the server and requesting
> something sometimes. 5 concurrent users can be 20, 50, 100 users who are
> logged in at the same time.
> >
> > Then there is this sad "share all vs. share nothing" argument. In
> Seaside you keep all your objects alive (read from db and materialized)
> between web requests. IN share nothing, you read everything back from
> disc/db whenever a request comes in. This also takes time and ressources
> (and pssibly blocks the server for the blink of an eye or two). You
> exchange RAM with CPU cycles and I/O. It is extremely hard to predict what
> works better, and I guess nobody ever made A/B tests. It's all just
> theoretical bla bla and guesses of what definitely must be better in one's
> world.
> >
> > Why do I come up with this share everything stuff? Because it usually
> means that each user that is logged on holds onto a load of objects on the
> server side (session storage), like their user account, shopping card,
> settings, last purchases, account information and whatnot. That's easily a
> list of a few thousand objects (and be it only Proxies) that take up space
> and want to be inspected by the garbage collector. So each connected user
> not only needs CPU cycles whenever they send a request to the server, but
> also uses RAM. In our case, this can easily be 5-10 MB of objects per user.
> Add to that the shadow copies that your persistence mechanism needs for
> undo and stuff, and all the data Seaside needs for Continuations etc, and
> each logged on users needs 15, 20 or more MB of object space. Connect ten
> users and you have 150-200 MB. That is not a problem per se, but also means
> there is some hard limit, especially in a 32 bit world. You don't want your
> server to slow down because it cannot allocate new memory or can't find
> contiguous slots for stuff and GCs all the time.
> >
> > To sum up, I think the number of influencing factors is way too high to
> really give a good estimate. Our experience (based on our mix of
> computation and I/O) says that 5 concurrent users per image is doable
> without negative impact on other users. Some operations take so much time
> that you really need to move them out of the front-facing image and
> distribute work to backend servers. More than 5 is probably possible but
> chances are that there are operations that will affect all users and with
> every additional user there is a growing chance that you have 2 or more
> requesting the yery same operation within a very short interval. This will
> make things worse and worse.
> >
> > So I trust in you guys having lots of cool tools around and knowing
> loads of tricks to wrench out much more power of a single Smalltalk image,
> but you also need to take a look at your productivity and speed in creating
> new features and fixing bugs. Sometimes throwing hardware at a problem like
> growth and starting with a clever architecture to scale on multiple layers
> is just the perfect thing to do. To me, handling 7 instead of 5 concurrent
> users is not such a big win as long as we are not in a posotion where we
> have so many users that this really matters. For sites like Amazon, Google,
> Facebook etc. saving 40% in server cost by optimizing the software
> (investing a few man years) is significant. I hope we'll soon change our
> mind about this question ;-)
> >
> > So load balancing and services outsourced to backend servers are key to
> scalability. This, btw, is not smalltalk specific (some people seem to
> think you won't get these problems in Java or Ruby because they are made
> for the web...).
> >
> > Joachim
>
> Everything you say, all your considerations, especially the last paragraph
> is/are correct and I agree.
>
> But some people will only remember the very low number you seem to be
> suggesting (which is more of a worse case scenario, with
> Seaside+blocking/slow connections to back end systems).
>
> One the other hand, plain HTTP access to a Pharo image can be quite fast.
> Here is quick & dirty benchmark I just did on one of our modern/big
> machines (inside an LXD container, light load) using a single stock image
> on Linux.
>
>
> $ pharo Pharo.image printVersion
> [version] 4.0 #40626
>
> $ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software: Zinc
> Server Hostname: 127.0.0.1
> Server Port: 1701
>
> Document Path: /bytes/32
> Document Length: 32 bytes
>
> Concurrency Level: 8
> Time taken for tests: 1.945 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10240
> Total transferred: 2109440 bytes
> HTML transferred: 327680 bytes
> Requests per second: 5265.17 [#/sec] (mean)
> Time per request: 1.519 [ms] (mean)
> Time per request: 0.190 [ms] (mean, across all concurrent requests)
> Transfer rate: 1059.20 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 2
> Processing: 0 2 8.0 2 309
> Waiting: 0 1 8.0 1 309
> Total: 0 2 8.0 2 309
>
> Percentage of the requests served within a certain time (ms)
> 50% 2
> 66% 2
> 75% 2
> 80% 2
> 90% 2
> 95% 3
> 98% 3
> 99% 3
> 100% 309 (longest request)
>
>
> More than 5K req/s (10K requests, 8 concurrent clients).
>
> Granted, this is only for just 32 bytes payload and the loopback network
> interface. But this is the other end of the interval, the maximum speed.
>
> A more realistic payload (7K HTML) gives the following:
>
>
> $ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
> This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
> Licensed to The Apache Software Foundation, http://www.apache.org/
>
> Benchmarking 127.0.0.1 (be patient)
> Completed 1024 requests
> Completed 2048 requests
> Completed 3072 requests
> Completed 4096 requests
> Completed 5120 requests
> Completed 6144 requests
> Completed 7168 requests
> Completed 8192 requests
> Completed 9216 requests
> Completed 10240 requests
> Finished 10240 requests
>
>
> Server Software: Zinc
> Server Hostname: 127.0.0.1
> Server Port: 1701
>
> Document Path: /dw-bench
> Document Length: 7734 bytes
>
> Concurrency Level: 8
> Time taken for tests: 7.874 seconds
> Complete requests: 10240
> Failed requests: 0
> Keep-Alive requests: 10240
> Total transferred: 80988160 bytes
> HTML transferred: 79196160 bytes
> Requests per second: 1300.46 [#/sec] (mean)
> Time per request: 6.152 [ms] (mean)
> Time per request: 0.769 [ms] (mean, across all concurrent requests)
> Transfer rate: 10044.25 [Kbytes/sec] received
>
> Connection Times (ms)
> min mean[+/-sd] median max
> Connect: 0 0 0.0 0 0
> Processing: 1 6 183.4 1 7874
> Waiting: 1 6 183.4 1 7874
> Total: 1 6 183.4 1 7874
>
> Percentage of the requests served within a certain time (ms)
> 50% 1
> 66% 1
> 75% 1
> 80% 1
> 90% 1
> 95% 1
> 98% 1
> 99% 1
> 100% 7874 (longest request)
>
>
> That is more than 1K req/s.
>
> In both cases we are talking about sub 1ms req/resp cycles !
>
> I think all commercial users of Pharo today know what is possible and what
> needs to be done to achieve their goals. Pure speed might not be the main
> consideration, ease/speed/joy of development and just being capable of
> solving complex problems and offering compelling solutions to end users is
> probably more important.
>
> Sven
>
>
>
>
Dec. 15, 2016
Re: [Pharo-users] [Pharo-dev] [ANN] Pharo Association has a new Website!
by Marcus Denker
>
>
> Sadly I had to remove everything as BitPay is not compatible with the legal
> structure of the association right now (dealing with US based companies wrt.
> money is getting very hard these days).
>
> So for us, using bitpay is sadly no option at this point.
>
I will explore http://coinwidget.com <http://coinwidget.com/> the next weeks, this seems to be much more what
we need actually.
Marcus
Dec. 15, 2016
Re: [Pharo-users] [Pharo-dev] [ANN] Pharo Association has a new Website!
by Marcus Denker
> On 12 Dec 2016, at 17:42, Marcus Denker <marcus.denker(a)inria.fr> wrote:
>
>>
>> On 8 Dec 2016, at 15:59, Marcus Denker <marcus.denker(a)inria.fr <mailto:marcus.denker@inria.fr>> wrote:
>>
>>
>>>
>>>> Accepting Bitcoin payments would be a plus ;-) (https://bitpay.com/tour <https://bitpay.com/tour>)
>>>>
>>>
>>
>> Hi,
>>
>> I have setup bitpay. This means we can now accept bitcoin, to pay by bitcoin,
>> for now please select âofflineâ payment and then send a mail to
>> association(a)pharo.org <mailto:association@pharo.org>
>>
>> and we will generate a bitcoin invoice. (we can integrate it a bit better later).
>>
>
> Hello,
>
> I now
> - added a link to donate by bitpay to https://association.pharo.org/Donate <https://association.pharo.org/Donate>
> - added payments links to the invoice that the system generates
> for paying the membership.
Hi,
Sadly I had to remove everything as BitPay is not compatible with the legal
structure of the association right now (dealing with US based companies wrt.
money is getting very hard these days).
So for us, using bitpay is sadly no option at this point.
Marcus
Dec. 15, 2016
Re: [Pharo-users] real world pharo web application set ups
by Sven Van Caekenberghe
Joachim,
> On 15 Dec 2016, at 11:43, jtuchel(a)objektfabrik.de wrote:
>
> Victor,
>
> Am 14.12.16 um 19:23 schrieb Vitor Medina Cruz:
>> If I tell you that my current estimate is that a Smalltalk image with Seaside will not be able to handle more than 20 concurrent users, in many cases even less.
>>
>> Seriously? That is kinda a low number, I would expect more for each image. Certainly it depends much on many things, but it is certainly very low for a rough estimate, why you say that?
>
> seriously, I think 20 is very optimistic for several reasons.
>
> One, you want to be fast and responsive for every single user, so there is absolutely no point in going too close to any limit. It's easy to lose users by providing bad experience.
>
> Second, in a CRUD Application, you mostly work a lot with DB queries. And you connect to all kinds of stuff and do I/O. Some of these things simply block the VM. Even if that is only for 0.3 seconds, you postpone processing for each "unaffected" user by these 0.3 seconds, so this adds to significant delays in response time. And if you do some heavy db operations, 0.3 seconds is not a terribly bad estimate. Add to that the materialization and stuff within the Smalltalk image.
>
> Seaside adapters usually start off green threads for each request. But there are things that need to be serialized (like in a critical Block). So in reality, users block each other way more often than you'd like.
>
> So if you asked me to give a more realistic estimation, I'd correct myself down to a number between 5 and probably a maximum of 10 users. Everything else means you must use all those fancy tricks and tools people mention in this thread.
> So what you absolutely need to do is start with an estimate of 5 concurrent users per image and look for ways to distribute work among servers/images so that these blocking situations are down to a minimum. If you find your software works much better, congratulate yourself and stack up new machines more slowly than initially estimated.
>
>
> Before you turn around and say: Smalltalk is unsuitable for the web, let's take a brief look at what concurrent users really means. Concurrent users are users that request some processing from the server at they very same time (maybe within an interval of 200-400msec). This is not the same as 5 people being currently logged on to the server and requesting something sometimes. 5 concurrent users can be 20, 50, 100 users who are logged in at the same time.
>
> Then there is this sad "share all vs. share nothing" argument. In Seaside you keep all your objects alive (read from db and materialized) between web requests. IN share nothing, you read everything back from disc/db whenever a request comes in. This also takes time and ressources (and pssibly blocks the server for the blink of an eye or two). You exchange RAM with CPU cycles and I/O. It is extremely hard to predict what works better, and I guess nobody ever made A/B tests. It's all just theoretical bla bla and guesses of what definitely must be better in one's world.
>
> Why do I come up with this share everything stuff? Because it usually means that each user that is logged on holds onto a load of objects on the server side (session storage), like their user account, shopping card, settings, last purchases, account information and whatnot. That's easily a list of a few thousand objects (and be it only Proxies) that take up space and want to be inspected by the garbage collector. So each connected user not only needs CPU cycles whenever they send a request to the server, but also uses RAM. In our case, this can easily be 5-10 MB of objects per user. Add to that the shadow copies that your persistence mechanism needs for undo and stuff, and all the data Seaside needs for Continuations etc, and each logged on users needs 15, 20 or more MB of object space. Connect ten users and you have 150-200 MB. That is not a problem per se, but also means there is some hard limit, especially in a 32 bit world. You don't want your server to slow down because it cannot allocate new memory or can't find contiguous slots for stuff and GCs all the time.
>
> To sum up, I think the number of influencing factors is way too high to really give a good estimate. Our experience (based on our mix of computation and I/O) says that 5 concurrent users per image is doable without negative impact on other users. Some operations take so much time that you really need to move them out of the front-facing image and distribute work to backend servers. More than 5 is probably possible but chances are that there are operations that will affect all users and with every additional user there is a growing chance that you have 2 or more requesting the yery same operation within a very short interval. This will make things worse and worse.
>
> So I trust in you guys having lots of cool tools around and knowing loads of tricks to wrench out much more power of a single Smalltalk image, but you also need to take a look at your productivity and speed in creating new features and fixing bugs. Sometimes throwing hardware at a problem like growth and starting with a clever architecture to scale on multiple layers is just the perfect thing to do. To me, handling 7 instead of 5 concurrent users is not such a big win as long as we are not in a posotion where we have so many users that this really matters. For sites like Amazon, Google, Facebook etc. saving 40% in server cost by optimizing the software (investing a few man years) is significant. I hope we'll soon change our mind about this question ;-)
>
> So load balancing and services outsourced to backend servers are key to scalability. This, btw, is not smalltalk specific (some people seem to think you won't get these problems in Java or Ruby because they are made for the web...).
>
> Joachim
Everything you say, all your considerations, especially the last paragraph is/are correct and I agree.
But some people will only remember the very low number you seem to be suggesting (which is more of a worse case scenario, with Seaside+blocking/slow connections to back end systems).
One the other hand, plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.
$ pharo Pharo.image printVersion
[version] 4.0 #40626
$ pharo Pharo.image eval 'ZnServer startDefaultOn: 1701. 1 hour wait' &
$ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests
Server Software: Zinc
Server Hostname: 127.0.0.1
Server Port: 1701
Document Path: /bytes/32
Document Length: 32 bytes
Concurrency Level: 8
Time taken for tests: 1.945 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10240
Total transferred: 2109440 bytes
HTML transferred: 327680 bytes
Requests per second: 5265.17 [#/sec] (mean)
Time per request: 1.519 [ms] (mean)
Time per request: 0.190 [ms] (mean, across all concurrent requests)
Transfer rate: 1059.20 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 2
Processing: 0 2 8.0 2 309
Waiting: 0 1 8.0 1 309
Total: 0 2 8.0 2 309
Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 2
95% 3
98% 3
99% 3
100% 309 (longest request)
More than 5K req/s (10K requests, 8 concurrent clients).
Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.
A more realistic payload (7K HTML) gives the following:
$ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests
Server Software: Zinc
Server Hostname: 127.0.0.1
Server Port: 1701
Document Path: /dw-bench
Document Length: 7734 bytes
Concurrency Level: 8
Time taken for tests: 7.874 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10240
Total transferred: 80988160 bytes
HTML transferred: 79196160 bytes
Requests per second: 1300.46 [#/sec] (mean)
Time per request: 6.152 [ms] (mean)
Time per request: 0.769 [ms] (mean, across all concurrent requests)
Transfer rate: 10044.25 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1 6 183.4 1 7874
Waiting: 1 6 183.4 1 7874
Total: 1 6 183.4 1 7874
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 1
95% 1
98% 1
99% 1
100% 7874 (longest request)
That is more than 1K req/s.
In both cases we are talking about sub 1ms req/resp cycles !
I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.
Sven
Dec. 15, 2016