Re: Advice: django deploy vps error 502

2017-03-07 Thread Daniel Hepper
Have a look at the Nginx module ngx_http_limit_req_module 
http://nginx.org/en/docs/http/ngx_http_limit_req_module.html

It allows you to limit the number of requests coming from a single address. 
This will probably be good enough to protect your site against a single 
person running ab, but it won't help against a proper DDoS attack.

Note that if you configure request limiting, that one person running ab 
will see errors, but the site will still work for anyone with a different 
IP address.

Hope that helps,

Daniel Hepper
https://consideratecode.com

On Thursday, March 2, 2017 at 6:56:55 PM UTC+1, sacrac wrote:
>
> Hi, ok i change the uwsgi to gunicorn right now, the problem with error 
> 502 in this moment he disappeared
> but the website in time it gets slow i dont now what is.
> this is the all syslog for today i this moments
>
> Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405] 
> [INFO] Booting worker with pid: 21405
> Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
> Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834] 
> [CRITICAL] WORKER TIMEOUT (pid:1844)
> Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +] [21459] 
> [INFO] Booting worker with pid: 21459
> Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
> Mar  2 17:37:43 prueba gunicorn[1834]: 
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>  
> Warning: Invalid utf8mb4 character string: 'F1613B'
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:37:43 prueba gunicorn[1834]: 
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>  
> Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent' at 
> row 1
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 > 
> /dev/null && debian-sa1 1 1)
>
> any good config for nginx and gunicor for high traffic website??
>
> or stop atack for many people make test like ab or other tools??
>
>
> thank for you help
>
>
>
> On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides <
> ant...@djangodeployment.com > wrote:
>
>> Your logs contain this:
>>
>> IOError: write error
>>
>> However, more information is needed in order to understand what is going 
>> on. A simple "write error" on its own is insufficient—is it a hardware 
>> error? Too many open files? Out of disk space? Something else? If your 
>> system writes nothing else in /var/log/syslog at the time the error occurs, 
>> it may be the fault of uwsgi that it doesn't show more information about 
>> the error. Try to increase error message verbosity, if there is an option 
>> to do that.
>>
>> Incidentally, the reason I migrated from uwsgi to gunicorn a few years 
>> ago was that every once in a while I was having a different problem with 
>> uwsgi, which was taking me hours to solve, largely because of insufficient 
>> documentation. After I switched to gunicorn I never looked back.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>>
>> On 03/01/2017 05:33 PM, carlos wrote:
>>
>> Hello, Antonis i have debug = false, yes 
>> uwsgi dont write anything in the log :/
>> When i see the syslog i see error but not understand!
>> i share this output
>>
>> http://pastebin.com/69yvC8Tz
>>
>> thak for you help
>>
>> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides <
>> ant...@djangodeployment.com > wrote:
>>
>>> Hello,
>>>
>>> 502 usually means the backend isn't running. After you finish the test, 
>>> has the backend stopped running? Does it continue to throw 502s? If that is 
>>> the case, I'm wildly guessing that processes might be growing and growing 
>>> in memory and being eventually killed, but I don't really know. Do you have 
>>> DEBUG = False? Does uwsgi write something in its log? Does the system write 
>>> something in the syslog?
>>>
>>> Regards,
>>>
>>> Antonis
>>>
>>> Antonis Christofideshttp://djangodeployment.com
>>>
>>>
>>> On 02/28/2017 10:49 PM, carlos wrote:
>>>
>>> Hi, all  
>>> i have one vps for one application,
>>>
>>>  vps description
>>>
>>> 16GB RAM
>>> 8 core processor
>>> 160 GB SSD
>>> 6TB Transfer
>>>
>>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 
>>> LTS
>>> this site working well when is visited or hits 1k even 6k, but when 
>>> visited 10k or 12k
>>> raiser error 502,
>>>
>>> When I do a test of ab like these command line
>>> ab -k -c 350 -n 2 mydomain.com/
>>> again raiser the error 502 in almost pages
>>>
>>> these are configs all, wsgi, nginx
>>>
>>>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
>>> http://pastebin.com/vQW47WGb
>>>
>>>  nginx conf in /etc/nginx/nginx.conf  --
>>> 

Re: Advice: django deploy vps error 502

2017-03-03 Thread Antonis Christofides
Hi,

No, the first message says it works with 6k requests, of which 350 are
concurrent, and doesn't work with 10k requests, of which 350 are concurrent. I
merely made some back-of-the-napkin calculation with some very crude assumptions
that 350 concurrent requests means you have a total of 100k users.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 03/03/2017 12:11 PM, ludovic coues wrote:
> First message clearly state that the site is running fine with 6,000 visitors
> but have issues with 10,000 and more.
>
> I'm most intrigued by the error message from MySQL on bad value for user 
> agent. 
>
> On 2 Mar 2017 9:18 p.m., "Antonis Christofides"  > wrote:
>
> 350 concurrent requests for a single machine is really much. If your app
> is very fast (e.g. by caching stuff a lot) it might be possible, but again
> it might require some tuning (for example, you could increase the gunicorn
> workers, but you need to be monitoring RAM consumption).
>
> Do you really need 350 concurrent requests? Do you have 100 thousand 
> users?
>
> Antonis Christofides
> http://djangodeployment.com
>
> On 03/02/2017 07:54 PM, carlos wrote:
>> Hi, ok i change the uwsgi to gunicorn right now, the problem with error
>> 502 in this moment he disappeared
>> but the website in time it gets slow i dont now what is.
>> this is the all syslog for today i this moments
>>
>> Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +]
>> [21405] [INFO] Booting worker with pid: 21405
>> Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 >
>> /dev/null && debian-sa1 1 1)
>> Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834]
>> [CRITICAL] WORKER TIMEOUT (pid:1844)
>> Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +]
>> [21459] [INFO] Booting worker with pid: 21459
>> Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 >
>> /dev/null && debian-sa1 1 1)
>> Mar  2 17:37:43 prueba gunicorn[1834]:
>> 
>> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>> Warning: Invalid utf8mb4 character string: 'F1613B'
>> Mar  2 17:37:43 prueba gunicorn[1834]:   return
>> self.cursor.execute(query, args)
>> Mar  2 17:37:43 prueba gunicorn[1834]:
>> 
>> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
>> Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent'
>> at row 1
>> Mar  2 17:37:43 prueba gunicorn[1834]:   return
>> self.cursor.execute(query, args)
>> Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 >
>> /dev/null && debian-sa1 1 1)
>>
>> any good config for nginx and gunicor for high traffic website??
>>
>> or stop atack for many people make test like ab or other tools??
>>
>>
>> thank for you help
>>
>>
>>
>> On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides
>> > 
>> wrote:
>>
>> Your logs contain this:
>>
>> IOError: write error
>>
>> However, more information is needed in order to understand what is
>> going on. A simple "write error" on its own is insufficient—is it a
>> hardware error? Too many open files? Out of disk space? Something
>> else? If your system writes nothing else in /var/log/syslog at the
>> time the error occurs, it may be the fault of uwsgi that it doesn't
>> show more information about the error. Try to increase error message
>> verbosity, if there is an option to do that.
>>
>> Incidentally, the reason I migrated from uwsgi to gunicorn a few
>> years ago was that every once in a while I was having a different
>> problem with uwsgi, which was taking me hours to solve, largely
>> because of insufficient documentation. After I switched to gunicorn I
>> never looked back.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>>
>> On 03/01/2017 05:33 PM, carlos wrote:
>>> Hello, Antonis i have debug = false, yes
>>> uwsgi dont write anything in the log :/
>>> When i see the syslog i see error but not understand!
>>> i share this output
>>>
>>> http://pastebin.com/69yvC8Tz
>>>
>>> thak for you help
>>>
>>> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides
>>> >
>>> wrote:
>>>
>>> Hello,
>>>
>>> 502 usually means the backend isn't running. After you finish
>>> the test, has the backend stopped running? Does it continue to
>>>  

Re: Advice: django deploy vps error 502

2017-03-03 Thread ludovic coues
First message clearly state that the site is running fine with 6,000
visitors but have issues with 10,000 and more.

I'm most intrigued by the error message from MySQL on bad value for user
agent.

On 2 Mar 2017 9:18 p.m., "Antonis Christofides" <
anto...@djangodeployment.com> wrote:

> 350 concurrent requests for a single machine is really much. If your app
> is very fast (e.g. by caching stuff a lot) it might be possible, but again
> it might require some tuning (for example, you could increase the gunicorn
> workers, but you need to be monitoring RAM consumption).
>
> Do you really need 350 concurrent requests? Do you have 100 thousand users?
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 03/02/2017 07:54 PM, carlos wrote:
>
> Hi, ok i change the uwsgi to gunicorn right now, the problem with error
> 502 in this moment he disappeared
> but the website in time it gets slow i dont now what is.
> this is the all syslog for today i this moments
>
> Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405]
> [INFO] Booting worker with pid: 21405
> Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
> Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834]
> [CRITICAL] WORKER TIMEOUT (pid:1844)
> Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +] [21459]
> [INFO] Booting worker with pid: 21459
> Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
> Mar  2 17:37:43 prueba gunicorn[1834]: /home/user/virtuales/website/
> local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
> Warning: Invalid utf8mb4 character string: 'F1613B'
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query,
> args)
> Mar  2 17:37:43 prueba gunicorn[1834]: /home/user/virtuales/website/
> local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
> Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent' at
> row 1
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query,
> args)
> Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
>
> any good config for nginx and gunicor for high traffic website??
>
> or stop atack for many people make test like ab or other tools??
>
>
> thank for you help
>
>
>
> On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides <
> anto...@djangodeployment.com> wrote:
>
>> Your logs contain this:
>>
>> IOError: write error
>>
>> However, more information is needed in order to understand what is going
>> on. A simple "write error" on its own is insufficient—is it a hardware
>> error? Too many open files? Out of disk space? Something else? If your
>> system writes nothing else in /var/log/syslog at the time the error occurs,
>> it may be the fault of uwsgi that it doesn't show more information about
>> the error. Try to increase error message verbosity, if there is an option
>> to do that.
>>
>> Incidentally, the reason I migrated from uwsgi to gunicorn a few years
>> ago was that every once in a while I was having a different problem with
>> uwsgi, which was taking me hours to solve, largely because of insufficient
>> documentation. After I switched to gunicorn I never looked back.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>>
>> On 03/01/2017 05:33 PM, carlos wrote:
>>
>> Hello, Antonis i have debug = false, yes
>> uwsgi dont write anything in the log :/
>> When i see the syslog i see error but not understand!
>> i share this output
>>
>> http://pastebin.com/69yvC8Tz
>>
>> thak for you help
>>
>> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides <
>> anto...@djangodeployment.com> wrote:
>>
>>> Hello,
>>>
>>> 502 usually means the backend isn't running. After you finish the test,
>>> has the backend stopped running? Does it continue to throw 502s? If that is
>>> the case, I'm wildly guessing that processes might be growing and growing
>>> in memory and being eventually killed, but I don't really know. Do you have
>>> DEBUG = False? Does uwsgi write something in its log? Does the system write
>>> something in the syslog?
>>>
>>> Regards,
>>>
>>> Antonis
>>>
>>> Antonis Christofideshttp://djangodeployment.com
>>>
>>>
>>> On 02/28/2017 10:49 PM, carlos wrote:
>>>
>>> Hi, all
>>> i have one vps for one application,
>>>
>>>  vps description
>>>
>>> 16GB RAM
>>> 8 core processor
>>> 160 GB SSD
>>> 6TB Transfer
>>>
>>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04
>>> LTS
>>> this site working well when is visited or hits 1k even 6k, but when
>>> visited 10k or 12k
>>> raiser error 502,
>>>
>>> When I do a test of ab like these command line
>>> ab -k -c 350 -n 2 mydomain.com/
>>> again raiser the error 502 in almost pages
>>>
>>> these are configs all, wsgi, nginx
>>>
>>>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
>>> 

Re: Advice: django deploy vps error 502

2017-03-02 Thread Antonis Christofides
350 concurrent requests for a single machine is really much. If your app is very
fast (e.g. by caching stuff a lot) it might be possible, but again it might
require some tuning (for example, you could increase the gunicorn workers, but
you need to be monitoring RAM consumption).

Do you really need 350 concurrent requests? Do you have 100 thousand users?

Antonis Christofides
http://djangodeployment.com

On 03/02/2017 07:54 PM, carlos wrote:
> Hi, ok i change the uwsgi to gunicorn right now, the problem with error 502 in
> this moment he disappeared
> but the website in time it gets slow i dont now what is.
> this is the all syslog for today i this moments
>
> Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405]
> [INFO] Booting worker with pid: 21405
> Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
> Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834]
> [CRITICAL] WORKER TIMEOUT (pid:1844)
> Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +] [21459]
> [INFO] Booting worker with pid: 21459
> Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
> Mar  2 17:37:43 prueba gunicorn[1834]:
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
> Warning: Invalid utf8mb4 character string: 'F1613B'
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:37:43 prueba gunicorn[1834]:
> /home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
> Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent' at 
> row 1
> Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query, 
> args)
> Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 >
> /dev/null && debian-sa1 1 1)
>
> any good config for nginx and gunicor for high traffic website??
>
> or stop atack for many people make test like ab or other tools??
>
>
> thank for you help
>
>
>
> On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides
> > wrote:
>
> Your logs contain this:
>
> IOError: write error
>
> However, more information is needed in order to understand what is going
> on. A simple "write error" on its own is insufficient—is it a hardware
> error? Too many open files? Out of disk space? Something else? If your
> system writes nothing else in /var/log/syslog at the time the error
> occurs, it may be the fault of uwsgi that it doesn't show more information
> about the error. Try to increase error message verbosity, if there is an
> option to do that.
>
> Incidentally, the reason I migrated from uwsgi to gunicorn a few years ago
> was that every once in a while I was having a different problem with
> uwsgi, which was taking me hours to solve, largely because of insufficient
> documentation. After I switched to gunicorn I never looked back.
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
>
> On 03/01/2017 05:33 PM, carlos wrote:
>> Hello, Antonis i have debug = false, yes
>> uwsgi dont write anything in the log :/
>> When i see the syslog i see error but not understand!
>> i share this output
>>
>> http://pastebin.com/69yvC8Tz
>>
>> thak for you help
>>
>> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides
>> > 
>> wrote:
>>
>> Hello,
>>
>> 502 usually means the backend isn't running. After you finish the
>> test, has the backend stopped running? Does it continue to throw
>> 502s? If that is the case, I'm wildly guessing that processes might
>> be growing and growing in memory and being eventually killed, but I
>> don't really know. Do you have DEBUG = False? Does uwsgi write
>> something in its log? Does the system write something in the syslog?
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>>
>> On 02/28/2017 10:49 PM, carlos wrote:
>>> Hi, all 
>>> i have one vps for one application,
>>>
>>>  vps description
>>>
>>> 16GB RAM
>>> 8 core processor
>>> 160 GB SSD
>>> 6TB Transfer
>>>
>>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu
>>> 16.04 LTS
>>> this site working well when is visited or hits 1k even 6k, but when
>>> visited 10k or 12k
>>> raiser error 502,
>>>
>>> When I do a test of ab like these command line
>>> ab -k -c 350 -n 2 mydomain.com/ 
>>> again raiser the error 502 in almost pages
>>>
>>> these are configs all, wsgi, nginx

Re: Advice: django deploy vps error 502

2017-03-02 Thread carlos
Hi, ok i change the uwsgi to gunicorn right now, the problem with error 502
in this moment he disappeared
but the website in time it gets slow i dont now what is.
this is the all syslog for today i this moments

Mar  2 17:21:02 prueba gunicorn[1834]: [2017-03-02 17:21:02 +] [21405]
[INFO] Booting worker with pid: 21405
Mar  2 17:25:01 prueba CRON[21454]: (root) CMD (command -v debian-sa1 >
/dev/null && debian-sa1 1 1)
Mar  2 17:25:23 prueba gunicorn[1834]: [2017-03-02 17:25:23 +] [1834]
[CRITICAL] WORKER TIMEOUT (pid:1844)
Mar  2 17:25:24 prueba gunicorn[1834]: [2017-03-02 17:25:24 +] [21459]
[INFO] Booting worker with pid: 21459
Mar  2 17:35:01 prueba CRON[21563]: (root) CMD (command -v debian-sa1 >
/dev/null && debian-sa1 1 1)
Mar  2 17:37:43 prueba gunicorn[1834]:
/home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
Warning: Invalid utf8mb4 character string: 'F1613B'
Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query,
args)
Mar  2 17:37:43 prueba gunicorn[1834]:
/home/user/virtuales/website/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:110:
Warning: Incorrect string value: '\xF1a;FBI...' for column 'user_agent' at
row 1
Mar  2 17:37:43 prueba gunicorn[1834]:   return self.cursor.execute(query,
args)
Mar  2 17:45:01 prueba CRON[21679]: (root) CMD (command -v debian-sa1 >
/dev/null && debian-sa1 1 1)

any good config for nginx and gunicor for high traffic website??

or stop atack for many people make test like ab or other tools??


thank for you help



On Thu, Mar 2, 2017 at 2:57 AM, Antonis Christofides <
anto...@djangodeployment.com> wrote:

> Your logs contain this:
>
> IOError: write error
>
> However, more information is needed in order to understand what is going
> on. A simple "write error" on its own is insufficient—is it a hardware
> error? Too many open files? Out of disk space? Something else? If your
> system writes nothing else in /var/log/syslog at the time the error occurs,
> it may be the fault of uwsgi that it doesn't show more information about
> the error. Try to increase error message verbosity, if there is an option
> to do that.
>
> Incidentally, the reason I migrated from uwsgi to gunicorn a few years ago
> was that every once in a while I was having a different problem with uwsgi,
> which was taking me hours to solve, largely because of insufficient
> documentation. After I switched to gunicorn I never looked back.
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 03/01/2017 05:33 PM, carlos wrote:
>
> Hello, Antonis i have debug = false, yes
> uwsgi dont write anything in the log :/
> When i see the syslog i see error but not understand!
> i share this output
>
> http://pastebin.com/69yvC8Tz
>
> thak for you help
>
> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides <
> anto...@djangodeployment.com> wrote:
>
>> Hello,
>>
>> 502 usually means the backend isn't running. After you finish the test,
>> has the backend stopped running? Does it continue to throw 502s? If that is
>> the case, I'm wildly guessing that processes might be growing and growing
>> in memory and being eventually killed, but I don't really know. Do you have
>> DEBUG = False? Does uwsgi write something in its log? Does the system write
>> something in the syslog?
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>>
>> On 02/28/2017 10:49 PM, carlos wrote:
>>
>> Hi, all
>> i have one vps for one application,
>>
>>  vps description
>>
>> 16GB RAM
>> 8 core processor
>> 160 GB SSD
>> 6TB Transfer
>>
>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04
>> LTS
>> this site working well when is visited or hits 1k even 6k, but when
>> visited 10k or 12k
>> raiser error 502,
>>
>> When I do a test of ab like these command line
>> ab -k -c 350 -n 2 mydomain.com/
>> again raiser the error 502 in almost pages
>>
>> these are configs all, wsgi, nginx
>>
>>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
>> http://pastebin.com/vQW47WGb
>>
>>  nginx conf in /etc/nginx/nginx.conf  --
>> http://pastebin.com/5BsWWaps
>>
>> - nginx vhost for my website mydpmain 
>> http://pastebin.com/bMPvmrwR
>>
>> How can I do so that the site does not throw the error?
>>
>> Are the settings correct?
>>
>> How can i know the layer support the vps?
>>
>> In nginx how to stop the ab test, if many people do the test the web site
>> throws the error 502 ngixn
>>
>> I would appreciate it if someone gave me an idea or advice to configure
>> better when there is high traffic or are doing ab test or another
>> benchmarking test
>>
>> cheers
>>
>> --
>> att.
>> Carlos Rocha
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> 

Re: Advice: django deploy vps error 502

2017-03-02 Thread Antonis Christofides
Your logs contain this:

IOError: write error

However, more information is needed in order to understand what is going on. A
simple "write error" on its own is insufficient—is it a hardware error? Too many
open files? Out of disk space? Something else? If your system writes nothing
else in /var/log/syslog at the time the error occurs, it may be the fault of
uwsgi that it doesn't show more information about the error. Try to increase
error message verbosity, if there is an option to do that.

Incidentally, the reason I migrated from uwsgi to gunicorn a few years ago was
that every once in a while I was having a different problem with uwsgi, which
was taking me hours to solve, largely because of insufficient documentation.
After I switched to gunicorn I never looked back.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 03/01/2017 05:33 PM, carlos wrote:
> Hello, Antonis i have debug = false, yes
> uwsgi dont write anything in the log :/
> When i see the syslog i see error but not understand!
> i share this output
>
> http://pastebin.com/69yvC8Tz
>
> thak for you help
>
> On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides
> > wrote:
>
> Hello,
>
> 502 usually means the backend isn't running. After you finish the test,
> has the backend stopped running? Does it continue to throw 502s? If that
> is the case, I'm wildly guessing that processes might be growing and
> growing in memory and being eventually killed, but I don't really know. Do
> you have DEBUG = False? Does uwsgi write something in its log? Does the
> system write something in the syslog?
>
> Regards,
>
> Antonis
>
> Antonis Christofides
> http://djangodeployment.com
>
>
> On 02/28/2017 10:49 PM, carlos wrote:
>> Hi, all 
>> i have one vps for one application,
>>
>>  vps description
>>
>> 16GB RAM
>> 8 core processor
>> 160 GB SSD
>> 6TB Transfer
>>
>> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 
>> LTS
>> this site working well when is visited or hits 1k even 6k, but when
>> visited 10k or 12k
>> raiser error 502,
>>
>> When I do a test of ab like these command line
>> ab -k -c 350 -n 2 mydomain.com/ 
>> again raiser the error 502 in almost pages
>>
>> these are configs all, wsgi, nginx
>>
>>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
>> http://pastebin.com/vQW47WGb
>>
>>  nginx conf in /etc/nginx/nginx.conf  --
>> http://pastebin.com/5BsWWaps
>>
>> - nginx vhost for my website mydpmain 
>> http://pastebin.com/bMPvmrwR
>>
>> How can I do so that the site does not throw the error?
>>
>> Are the settings correct?
>>
>> How can i know the layer support the vps?
>>
>> In nginx how to stop the ab test, if many people do the test the web site
>> throws the error 502 ngixn
>>
>> I would appreciate it if someone gave me an idea or advice to configure
>> better when there is high traffic or are doing ab test or another
>> benchmarking test
>>
>> cheers
>>
>> -- 
>> att.
>> Carlos Rocha
>> -- 
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at https://groups.google.com/group/django-users
>> .
>> To view this discussion on the web visit
>> 
>> https://groups.google.com/d/msgid/django-users/CAM-7rO1u-ih5pd9b2AEEDLBJRL7DUvhVDs9hfZjpyGH_fHKJbQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout
>> .
>
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users
> .
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/7624c177-e769-5fd6-496e-5ab07a927783%40djangodeployment.com

Re: Advice: django deploy vps error 502

2017-03-01 Thread carlos
Hello, Antonis i have debug = false, yes
uwsgi dont write anything in the log :/
When i see the syslog i see error but not understand!
i share this output

http://pastebin.com/69yvC8Tz

thak for you help

On Wed, Mar 1, 2017 at 12:58 AM, Antonis Christofides <
anto...@djangodeployment.com> wrote:

> Hello,
>
> 502 usually means the backend isn't running. After you finish the test,
> has the backend stopped running? Does it continue to throw 502s? If that is
> the case, I'm wildly guessing that processes might be growing and growing
> in memory and being eventually killed, but I don't really know. Do you have
> DEBUG = False? Does uwsgi write something in its log? Does the system write
> something in the syslog?
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 02/28/2017 10:49 PM, carlos wrote:
>
> Hi, all
> i have one vps for one application,
>
>  vps description
>
> 16GB RAM
> 8 core processor
> 160 GB SSD
> 6TB Transfer
>
> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 LTS
> this site working well when is visited or hits 1k even 6k, but when
> visited 10k or 12k
> raiser error 502,
>
> When I do a test of ab like these command line
> ab -k -c 350 -n 2 mydomain.com/
> again raiser the error 502 in almost pages
>
> these are configs all, wsgi, nginx
>
>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
> http://pastebin.com/vQW47WGb
>
>  nginx conf in /etc/nginx/nginx.conf  --
> http://pastebin.com/5BsWWaps
>
> - nginx vhost for my website mydpmain 
> http://pastebin.com/bMPvmrwR
>
> How can I do so that the site does not throw the error?
>
> Are the settings correct?
>
> How can i know the layer support the vps?
>
> In nginx how to stop the ab test, if many people do the test the web site
> throws the error 502 ngixn
>
> I would appreciate it if someone gave me an idea or advice to configure
> better when there is high traffic or are doing ab test or another
> benchmarking test
>
> cheers
>
> --
> att.
> Carlos Rocha
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAM-7rO1u-ih5pd9b2AEEDLBJRL7DUvhVDs9hfZj
> pyGH_fHKJbQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/7624c177-e769-5fd6-496e-5ab07a927783%
> 40djangodeployment.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO31bj6O8L_s-hoVn13zV11UFuV9Wtd4EbJBS9EcFz%3DDtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice: django deploy vps error 502

2017-02-28 Thread Antonis Christofides
Hello,

502 usually means the backend isn't running. After you finish the test, has the
backend stopped running? Does it continue to throw 502s? If that is the case,
I'm wildly guessing that processes might be growing and growing in memory and
being eventually killed, but I don't really know. Do you have DEBUG = False?
Does uwsgi write something in its log? Does the system write something in the
syslog?

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 02/28/2017 10:49 PM, carlos wrote:
> Hi, all 
> i have one vps for one application,
>
>  vps description
>
> 16GB RAM
> 8 core processor
> 160 GB SSD
> 6TB Transfer
>
> ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 LTS
> this site working well when is visited or hits 1k even 6k, but when visited
> 10k or 12k
> raiser error 502,
>
> When I do a test of ab like these command line
> ab -k -c 350 -n 2 mydomain.com/ 
> again raiser the error 502 in almost pages
>
> these are configs all, wsgi, nginx
>
>  uwsgi script in /etc/uwsgi/app-availabre/website.ini -
> http://pastebin.com/vQW47WGb
>
>  nginx conf in /etc/nginx/nginx.conf  --
> http://pastebin.com/5BsWWaps
>
> - nginx vhost for my website mydpmain 
> http://pastebin.com/bMPvmrwR
>
> How can I do so that the site does not throw the error?
>
> Are the settings correct?
>
> How can i know the layer support the vps?
>
> In nginx how to stop the ab test, if many people do the test the web site
> throws the error 502 ngixn
>
> I would appreciate it if someone gave me an idea or advice to configure better
> when there is high traffic or are doing ab test or another benchmarking test
>
> cheers
>
> -- 
> att.
> Carlos Rocha
> -- 
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAM-7rO1u-ih5pd9b2AEEDLBJRL7DUvhVDs9hfZjpyGH_fHKJbQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7624c177-e769-5fd6-496e-5ab07a927783%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Advice: django deploy vps error 502

2017-02-28 Thread carlos
Hi, all
i have one vps for one application,

 vps description

16GB RAM
8 core processor
160 GB SSD
6TB Transfer

ok, i am using, uwsgi(2.0.14), nginx(1.10), mysql(5.6 )and ubuntu 16.04 LTS
this site working well when is visited or hits 1k even 6k, but when visited
10k or 12k
raiser error 502,

When I do a test of ab like these command line
ab -k -c 350 -n 2 mydomain.com/
again raiser the error 502 in almost pages

these are configs all, wsgi, nginx

 uwsgi script in /etc/uwsgi/app-availabre/website.ini -
http://pastebin.com/vQW47WGb

 nginx conf in /etc/nginx/nginx.conf  --
http://pastebin.com/5BsWWaps

- nginx vhost for my website mydpmain 
http://pastebin.com/bMPvmrwR

How can I do so that the site does not throw the error?

Are the settings correct?

How can i know the layer support the vps?

In nginx how to stop the ab test, if many people do the test the web site
throws the error 502 ngixn

I would appreciate it if someone gave me an idea or advice to configure
better when there is high traffic or are doing ab test or another
benchmarking test

cheers

-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO1u-ih5pd9b2AEEDLBJRL7DUvhVDs9hfZjpyGH_fHKJbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.