I found the problem.  It's in the configuration file.

And specifically what the problem is is that I ran hypnotoad as a non-root
user and of course hypnotoad can't set the user and group to www-data as
defined by default in the config.  So likely this is what your other users
are experiencing as well.  They also are (rightly so) not running your app
as root and the instructions do no state anything in regards to modifying
your default configuration of setting user and group for cases when you
execute your app as an unprivileged user.


On Fri, Mar 7, 2014 at 6:38 AM, Stefan Adams <[email protected]> wrote:

> Something that I find interesting is that by default hypnotoad workers = 4
> and clients = 1000 and they aren't defined any where in your code to
> override that, yet I see only one process running where I'd normally see a
> manager and 4 workers.  Moreover, I specified the hypnotoad defaults in
> lutim.conf and it didn't make a difference.  So what in your code is
> causing this behavior?
>
> On another note, while I'm not sure what is typical behavior, I ran strace
> on the one lutim process and it was running like mad -- clearly the reason
> why the CPU load was so high.
>
> $ ps axf | grep mojo
> 18733 ?        Rs     *0:02*          \_
> /home/stefan/Data/mojo/lutim/script/lutim
>
>
> The 0:02 bold column was increasing every second.  Another proof of the
> 100% CPU use.
>
> I wish I knew what it was doing exactly.  Here's a snippet from strace, it
> pretty much just loops this from what I can tell.
>
> $ sudo strace -p 18733
>
> stat("/home/stefan/Data/mojo/lutim/script/hypnotoad.pid",
> {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> poll([{fd=3, events=POLLIN}], 1, 1000)  = ? ERESTART_RESTARTBLOCK
> (Interrupted by signal)
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23052,
> si_status=1, si_utime=0, si_stime=1} ---
> rt_sigreturn()                          = -1 EINTR (Interrupted system
> call)
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> rt_sigaction(SIGCHLD, NULL, {0x7f0c1c385110, [], SA_RESTORER,
> 0x7f0c1bf64ff0}, 8) = 0
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 23052
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 23051
> wait4(-1, 0x7fff7020c05c, WNOHANG, NULL) = 0
> rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23051,
> si_status=1, si_utime=0, si_stime=0} ---
> rt_sigreturn()                          = 0
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> rt_sigaction(SIGCHLD, NULL, {0x7f0c1c385110, [], SA_RESTORER,
> 0x7f0c1bf64ff0}, 8) = 0
> wait4(-1, 0x7fff7020bf0c, WNOHANG, NULL) = 0
> rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7f0c1c870a10) = 23055
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7f0c1c870a10) = ? ERESTARTNOINTR (To be restarted)
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23054,
> si_status=1, si_utime=0, si_stime=0} ---
> rt_sigreturn()                          = 56
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7f0c1c870a10) = 23057
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> rt_sigaction(SIGCHLD, NULL, {0x7f0c1c385110, [], SA_RESTORER,
> 0x7f0c1bf64ff0}, 8) = 0
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 23054
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG, NULL) = 23053
> wait4(-1, 0x7fff7020c0cc, WNOHANG, NULL) = 0
> rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
> --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23053,
> si_status=1, si_utime=0, si_stime=1} ---
> rt_sigreturn()                          = 0
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> rt_sigaction(SIGCHLD, NULL, {0x7f0c1c385110, [], SA_RESTORER,
> 0x7f0c1bf64ff0}, 8) = 0
> wait4(-1, 0x7fff7020bf7c, WNOHANG, NULL) = 0
> rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7f0c1c870a10) = 23058
> clone(child_stack=0,
> flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0x7f0c1c870a10) = 23059
>
>
>
>
> On Fri, Mar 7, 2014 at 6:19 AM, Stefan Adams <[email protected]> wrote:
>
>> Looks like a really nice app!
>>
>> FWIW, hypnotoad is also consuming 100% CPU for me on Ubuntu 13.10.
>>
>> I followed the instructions exactly and modified only the contact
>> configuration line as that was a requirement to start the server.
>>
>>
>> On Thu, Mar 6, 2014 at 10:03 AM, Luc Didry <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I developed an image hosting service with Mojolicious but some users
>>> which installed it have 100% CPU consumption with hypnotoad.
>>>
>>> One have Linux Mint 16 as OS and the other uses raspian on a raspberryPi
>>>
>>> I said them to try with morbo and that works well : low CPU consumption.
>>>
>>> In my install instructions, I told users to use Carton since it's -- for
>>> me -- the best and simplest way to handle dependancies and to be able to
>>> use multiple versions of Mojolicious on the same machine:
>>> I got some other Mojolicious apps on my server and I don't want to
>>> update them if something goes wrong with a new version of Mojolicious,
>>> they are simple apps just for my usage (quick and dirty code, but that
>>> do the job).
>>>
>>> Do you have any idea on what causes hypnotoad to take all the CPU?
>>>
>>> My app : https://github.com/ldidry/lutim (please, be kind on the code, I
>>> know there is some refactoring to do to make it better).
>>>
>>> Thank you.
>>> --
>>> Luc
>>> http://www.fiat-tux.fr/
>>> Internet n'est pas compliqué, Internet est ce que vous en faites.
>>>
>>>
>>
>

-- 
*Keystone IT <http://www.keystone-it.com> NOTICE:*  This e-mail (including 
attachments) is covered by the Electronic Communications Privacy Act, 18 
U.S.C. 2510-2521, is confidential and is legally privileged.  If you are 
not the intended recipient, you are hereby notified that the unauthorized 
use, in any way, of this communication is strictly prohibited.  If you have 
received this e-mail in error, please delete it immediately and call us at * 
(314) 
621-9500* to correct the problem.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to