can't reach site runs on Drogon
according to logs, Drogon runs successfully, but when I try to open the site, I get "Application failed to respond".
39 Replies
Project ID:
8c09c3c7-3c6b-469e-98a6-32062758ed19
8c09c3c7-3c6b-469e-98a6-32062758ed19
this docs page will help you
https://docs.railway.app/troubleshoot/fixing-common-errors
in application I'm already use
0.0.0.0
as host and 80
port
according to guide now I set PORT
variable as 80
, but nothing changesthat is actually not recommended
you should ideally not be setting a PORT variable yourself
please show me the app().addListener line
this docs page will help you
https://docs.railway.app/troubleshoot/fixing-common-errors
just to clearly reiterate on what that docs page wants you to do, listen on the environment variable PORT in your code
you mean that I need to get env var in code ?
oh, I get that
yes, there are code examples at the bottom, none for c++ but that still gives you an idea of what needs to be done
railway has its own hidden PORT var
earlier for my ASP.NET site I just set PORT var by my self
k, I'll try
that is not the recommended method
from railway I got 5563 port, but I still can't access to site
show me the code please
same bit of code you've already shown me
looks good
now, does this start an http server?
yep I guess
you guess?
but strange that I don't see log about home controller... when I run it locally it shows it
I've different logs locally and on railway
locally I've no
logs
I've that
why the enable run as deamon? when not on windows
locally I can't run daemon, but why I don't get "run" log idk
why do you want to run the deamon anywhere
wouldn't it be better that default run ?
k, I'll try to run it normally on railway
I don't know, tell me the differences?
I'm not a cpp dev
as I understand, daemon mode, is designed for background web-services
so I guess it'll be better to run server as daemon
what makes you think you should run your app as a background service?
idk how on linux, but on windows background tasks runs in different priority of resources
so I'd like that my app consume as small amount of them as it can
I see your thought process, but that's not quite how it works
that's like "child trauma" after ASP.NET, that allocating +-300-400mb RAM for empty project)
I mean that can be solved by simply not using languages and frameworks that are known to use a lot of resources
I've two main points to use cpp
1. is learn something new
2. create more efficient site, bot etc
what's the memory usage like for a cpp app that uses drogon?
I was interested in cpp few years ago, but chanse to "tuch" it came only now)
for now, for empty app, +-3mb, I guess it'll about 20-50mb after I'll end with transfer from ASP
ay now that's awesome
in case of ASP, only runtime allocates +-100-150mb of RAM, other 100-200mb allocates to some ASP services
just cuz of GC, app will allocate +-300-400 for long time, without clearing
I tried to raise GC collections manually, and it clear up RAM back to 100-150
but by the time, ASP again creating lots of trash
in case of cpp, and drogon, all memory clears immediately, an it doesn't need any runtime
so app allocates as small amount of resources as it really needs
thats no fun
yep, I remove daemon mode and it runs fine
awsome!
thx for helping <3
enjoy the cheaper railway bills too!