Re: least_conn not working for me

2020-12-23 Thread Peter Booth
From a shell on your nginx host you can run something like netstat -ant | egrep “ESTAB” to see all the open TCP connections. If you run your command line with watch you will see it update each two seconds, etc .. FWIW A long time ago I did a bunch of experiments with different load balancer str

Re: Nginx proxy_bind failing

2020-10-31 Thread Peter Booth
Gary, This was interesting to read. There was one thing that wasn’t obvious to me however. What was the high level problem that you were solving with this specific configuration? Curiously Peter Sent from my iPhone > On Oct 30, 2020, at 3:16 PM, garyc...@yahoo.com > wrote: > > All: >

Re: Is this an attack or a normal request?

2020-08-24 Thread Peter Booth
I agree with the advice already given It can also be useful to track the User-Agent header of web requests - both to understand who is trying to do what to your website, and then to start blocking on the basis of user agent. There may be some bots and spiders that are helpful or even necessary f

Re: Nginx pre-configured test environment with all scenarios

2020-07-05 Thread Peter Booth
Why are you doing an nginx POC? To be blunt, nginx is the most powerful, flexible web server/reverse proxy/application delivery software product that exists. If it has an obvious competitor it’s the F5 BigIP LTM/WAF device - and F5 owns nginx. So what does this mean? It means that if you don’t

Re: Per IP bandwidth limit

2019-11-11 Thread Peter Booth
Why do you want to do this at all? What is the real underlying problem that you are attempting to solve? > On Nov 11, 2019, at 8:29 AM, Kostya Velychkovsky > wrote: > > I use Linux, and had a bad experience with Linux shaper (native kernel QoS > mechanism - tc ), it consumed a lot of CPU an

Re: Odd behavior

2019-10-09 Thread Peter Booth
Is your web server on the internet? If so then see what redbot shows. It’s an amazing tool to debug nuanced http issues Sent from my iPhone > On Oct 9, 2019, at 1:52 AM, Ken Wright wrote: > > Sorry to be taking up so much bandwidth lately, but I'm seeing some > weird behavior from nginx. > >

Re: Resident memory not released

2019-08-01 Thread Peter Booth via nginx
I’m wondering if you are overthinking this. You said that the memory was reused when the workload increased again. Linux memory management is unintuitive. What would happen if you used a different metric, say # active connections, as your autoscaling metric? It sounds like this would behave “bet

Re: Nginx request processing is slow when logging disabled

2019-07-16 Thread Peter Booth via nginx
I’d suggest that you use wrk2, httperf, ab or similar to run a synthetic test. Can your site handle one request every five seconds? One request every second? Five every second? ... is your backend configured to log service times? Is your nginx configured to log service times? What do you see? By

Re: HTTPS Pinning

2019-06-07 Thread Peter Booth via nginx
Andreas, Do you know of any large, high traffic sites that are using HSTS today? Peter > On Jun 5, 2019, at 12:56 PM, A. Schulze wrote: > > > > Am 05.06.19 um 14:54 schrieb Sathish Kumar: >> Hi Team, >> >> We would like to fix the HTTPS pinning vulnerability on our Nginx and Mobile >> appl

Re: Capture clear text with Nginx reverse proxy

2019-05-05 Thread Peter Booth via nginx
Mik, I’m not going to get into the openbsd question, but I can tell you some of the different things that I have done to solve this kind of problem in the past. Your environmental constraints will impact which is feasible: 1. Use tcpdump to capture packets 2. Use netcat as an intercepting proxy

Re: Optimize SO for nginx

2019-04-19 Thread Peter Booth via nginx
Where is your upstream? Where is your pho executing? Do you have a CDN? There’s three parts to this: 1 fix the bad OS defaults: If you are using RHEL 6 this would mean: Enabling tuned Disabling THP Increasing vm.min_free_kbytes Reducing swappiness 2 generic web server specific configuration Increa

Re: [no subject]

2019-04-13 Thread Peter Booth via nginx
I don’t think it’s a dumb question at all. It’s a very astute question. My experience of protecting a high traffic retail website from a foreign state-sponsored DDOS was that doing IP blocking on a hardware load bakancer in front of the nginx tier was the difference between the site bring avail

Re: Mapping url to physical urls using lua script or something else.

2019-03-23 Thread Peter Booth via nginx
Here’s my opinion: You can do this however you want. It’s your website. Most of my work has been for other people. When I was working on my own startup it made me honest. Nothing was dynamic. The rationale was “do everything ahead of time so users never wait for anything and the site has 100%

Re: Possible memory leak?

2019-03-12 Thread Peter Booth via nginx
Perhaps I’m naive or just lucky, but I have used nginx on many contracts and permanent jobs for over ten years and have never attempted to reload canfigurations. I have always stopped then restarted nginx instances one at a time. Am I not recognizing a constraint that affects other people? Curi

Re: Sporadic long response times with upstream server

2019-02-21 Thread Peter Booth via nginx
Jon, You need to find out what is “true”. From the perspective of nginx, this post request took 3.02 secs - but where was the time actually spent? Do you have root access on both your nginx host and your upstream host that is behind your elastic load balancer? If so, you can run a filtered tcpdu

Re: Nginx Reverse Proxy Caching

2019-02-13 Thread Peter Booth via nginx
Satish, The browser (client-side) cache isn’t related to the nginx reverse proxy cache. You can tell Chrome to not cache html by adding the following to your location definition: add_header Cache-Control 'no-store'; You can use Developer Tool in Chrome to check that it is working. Peter Sent

Re: I'm about to embark on creating 12000 vhosts

2019-02-11 Thread Peter Booth via nginx
+1 to the openresty suggestion I’ve found that whenever I want to do something gnarly or perverse with nginx, openresty helps me do it in a way that’s maintainable and with any ugliness minimized. It’s like nginx with super-powers! Sent from my iPhone > On Feb 11, 2019, at 1:34 PM, Robert Pap

Re: STALE responses taking as much as MISS responses

2019-02-11 Thread Peter Booth via nginx
behavior. Peter > On 11 Feb 2019, at 2:00 PM, Peter Booth wrote: > > You should be able to answer this by tailing the log of your nginx and orig > server at the same time. > > It would be helpful if you shared an (anonymized) section of both logs. When > I say fast or slow >

Re: STALE responses taking as much as MISS responses

2019-02-11 Thread Peter Booth via nginx
You should be able to answer this by tailing the log of your nginx and orig server at the same time. It would be helpful if you shared an (anonymized) section of both logs. When I say fast or slow I might mean something very different to what you hear. > On 11 Feb 2019, at 10:06 AM, joao.pere

Re: Random 404 Errors

2019-01-28 Thread Peter Booth via nginx
Open this and you will see that a request to https://digitalkube.com/ returns a 301 pointing back to itself. Check your CDN configuration https://redbot.org/?uri=https%3A%2F%2Fdigitalkube.com%2F Sent from my iPhone > On Jan 28, 2019, at 11:47 AM, Gary wrote: > > Log files? Nginx.conf file? Y

Re: OWIN Server Error

2019-01-21 Thread Peter Booth via nginx
Petrosetta, Question is your nginx server running on the same host as your owin / IIS server? With OWIN / IIS listening only on port 80 and nginx only on port 443? And both listening on the physical NIC (not localhost) and no firewall? It looks as though you are wanting to do SSL termination an

Re: Set browser cache to current month!

2019-01-13 Thread Peter Booth via nginx
If you use the openresty nginx distribution then you can write a few lines of Lua to implement your custom logic. Sent from my iPhone > On Jan 13, 2019, at 9:13 AM, shahzaib mushtaq wrote: > > Hi, > > We've a location like /school for which we want to set browser cache lifetime > as 'current

Re: Nginx hang and do not respond with large number of network connection in FIN_WAIT state

2019-01-10 Thread Peter Booth via nginx
Is your nginx/Apache site visible on the internet without any authentication? If so, I recommend that you access your site directly, not through cloud flare with redbot.org, which is the best HTTP debugger ever, for both the nginx and Apache versions of the site and see how they compare. Why is

Re: Nginx hang and do not respond with large number of network connection in FIN_WAIT state

2019-01-10 Thread Peter Booth via nginx
1. What does GET / return? 2. You said that nginx was configured as a reverse proxy. Is / proxied to a back-end? 3. Does GET / return the same content to different users? 4. Is the user-agent identical for these suspicious requests? Sent from my iPhone > On Jan 10, 2019, at 11:19 PM, gnusys wr

Re: Nginx hang and do not respond with large number of network connection in FIN_WAIT state

2019-01-10 Thread Peter Booth via nginx
How do you know that this is an attack and not “normal traffic?” How are these requests different from regular requests? What do the weblogs say about the “attack requests?" > On 10 Jan 2019, at 10:30 PM, gnusys wrote: > > My Current settings are higher except the worker_process > > worker_pro

Re: Nginx hang and do not respond with large number of network connection in FIN_WAIT state

2019-01-10 Thread Peter Booth via nginx
Your web server logs should have the key to solving this. Do you know what url was being requested? Do the URLs look valid? Are there requests all for the same resource? Are the requests coming from a single IP range? Are the requests all coming with the same user-agent? Does the time this starte

Re: Nginx hang and do not respond with large number of network connection in FIN_WAIT state

2019-01-09 Thread Peter Booth via nginx
The important question here is not the connections in FIN_WAIT. It’s “why do you have so many sockets in ESTABLISHED state?” First thing to do is to run netstat -ant | grep tcp and see where these connections are to. Do you have a configuration that is causing an endless loop of requests? Sent

Re: Can Nginx handle millions of static pages or pictures ?

2018-11-02 Thread Peter Booth via nginx
nts are difficult to be generated in advance such as > the the contents of some search results. There are lots of search words for a > website for which there are too many result items. How should we handle this > issue? > > > > At 2018-11-02 21:16:18, "Peter Booth via ngin

Re: Can Nginx handle millions of static pages or pictures ?

2018-11-02 Thread Peter Booth via nginx
So this is a very interesting question. I started writing dynamic websites in 1998. Most developers don’t want to generate static sites. I think their reasons are more emotional than technical. About seven years ago I had two jobs - the day job was a high traffic retail fashion website. the side

Re: Nginx cache returning empty response for just the home page

2018-10-09 Thread Peter Booth via nginx
e have the script? My problem is intermittent and I don’t > know if it’s a good idea to actively listen to production logging. > > > > > On Sat, Oct 6, 2018 at 3:21 PM Peter Booth via nginx <mailto:nginx@nginx.org>> wrote: > You need to understand what requests are b

Re: Nginx cache returning empty response for just the home page

2018-10-06 Thread Peter Booth via nginx
You need to understand what requests are being received, what responses are being sent and the actual keys being used to write to your cache. This means intelligent request logging, possibly use of redbot.org, and examination of your cache. I used to use a script that someone had posted here y

Re: Avoiding Nginx restart when rsyncing cache across machines

2018-09-13 Thread Peter Booth via nginx
One more approach is to not change the contents of resources without also changing their name. One example would be the cache_key feature in Rails, where resources have a path based on some ID and their updated_at value. Whenever you modify a resource it automatically expires. Sent from my iPho

Re: Avoiding Nginx restart when rsyncing cache across machines

2018-09-12 Thread Peter Booth via nginx
Quintin, Are most of your requests for dynamic or static content? Are the requests clustered such that there is a lot of requests for a few (between 5 and 200, say) URLs? If three different people make same request do they get personalized or identical content returned? How long are the cached r

Re: limit_rate based on User-Agent; how to exempt /robots.txt ?

2018-08-06 Thread Peter Booth via nginx
So it’s very easy to get caught up in he trap if having unrealistic mental models of how we servers work when dealing with web servers. If your host is a recent (< 5 years) single Dickey host then you can probably support 300,000 requests per second fir your robots.txt file. That’s because the f

Re: How are you managing CI/CD for your nginx configs?

2018-07-17 Thread Peter Booth via nginx
I’ve tried chef, puppet and ansible at thre different shops. I wanted to like chef and puppet because they are Ruby based (which I like) but they seemed clunky, ugly, and heavyweight. Ansible seemed to solve the easy problems. When I had a startup I just used Capistrano for deployments, with erb

Re: Cache question

2018-06-28 Thread Peter Booth
Sure is. Look at the stale-if-error stale-while-revalidate proxy_cache_use_stale proxy_cache_lock etc Can you describe the use case a bit more? Why don't you want to cache this particular content? Is it that its dynamic and a fresher version is always preferable but the stale is good enough in

Re: Recovering from partial writes

2018-06-22 Thread Peter Booth
How large is a large POST payload? Are the nginx and upstream systems physical hosts in same data center? What are approx best case / typical case / worst case latency for the post to upstream? Sent from my iPhone > On Jun 22, 2018, at 2:40 PM, scott.o...@oracle.com wrote: > > I have an nginx p

Re: NGINX Proxy Cache Cache-Control

2018-06-22 Thread Peter Booth
Your question raises so many other questions: 1. The static content - jpg, png, tiff, etc. It looks as though you are serving them your backend and caching them. Are they also being built on demand dynamically? If not, then why csche them? Why not deploy them to nginx and serve them directly?

Re: massive deleted open files in proxy cache

2018-06-20 Thread Peter Booth
Sounds weird. 1. It doesn’t make sense for your cache to be on a tmpfs share. Better to use s physical disk allow Linux ‘s page csche to do its job 2. How big are the files in the larger cache? Min/median/max? Sent from my iPhone > On Jun 20, 2018, at 7:38 AM, rihad wrote: > > Have you be

Re: Performance of h2 is better than h2c

2018-06-08 Thread Peter Booth
Is your client running n a different host than your server? > On 8 Jun 2018, at 5:35 AM, prabhat wrote: > > I am taking performance data on nginx. > The client I used is h2load > > Request per second using h2 is much higher than h2c. But I think it should > not be as h2 is having the overhead o

Re: Block countries - Nginx

2018-05-24 Thread Peter Booth
Dont. You should let every tier do it’s job. Just because nginx has geoid functionality doesn’t mean that you should use it. If you are lucky enough to have hardware load balancer in front of nginx then do the blocking there, so you reduce the load on your nginx. The Golden Rule of keeping websi

Re: Block countries - Nginx

2018-05-23 Thread Peter Booth
If you can dump your http traffic you will probably see a headers with names like: X-Real-IP X-Forwarded-For Sent from my iPhone > On May 23, 2018, at 11:25 PM, Frank Liu wrote: > > Since only load balancer sees the client IP, it has to pass that information > to nginx. You need to talk to yo

Re: Nginx Rate limiting for HTTPS requests

2018-05-20 Thread Peter Booth
5. Do you use keepslive? Sent from my iPhone > On May 20, 2018, at 2:45 PM, Peter Booth wrote: > > Rate limiting is a useful but crude tool that should only be one if four or > five different things you do to protect your backend: > > 1 browser caching > 2 cDN > 3

Re: Nginx Rate limiting for HTTPS requests

2018-05-20 Thread Peter Booth
Rate limiting is a useful but crude tool that should only be one if four or five different things you do to protect your backend: 1 browser caching 2 cDN 3 rate limiting 4 nginx caching reverse proxy What are your requests? Are they static content or proxied to a back end? Do users login? Is i

Re: Debugging Nginx Cache Misses: Hitting high number of MISS despite high proxy valid

2018-05-14 Thread Peter Booth
Quintin, I dont know anything about your context, but your setup looks over simplistic. Here are some things that I learned painfully over a few years of supporting a high traffic retail website 1. Is this a website that's on the internet, and thus exposed to random queries from bots and scra

Re: Error: Couldn't connect to server

2018-04-27 Thread Peter Booth
I’m guessing that you have script that keeps executing curl. What you can do is use curl -K ./fileWithListOfUrls.txt and the one curl process will visit each url in turn reusing the socket (aka HTTP keep alive) That said, curl isn’t a great workload simulator and, in the long time, you can get

Re: Virtual hosts sharing same port

2018-04-16 Thread Peter Booth
Does this imply that that different behavior *could* be achieved by first defining virtual IP addresses (additional private IPs defined at the OS) which were bound to same physical NIC, and then defining virtual hosts that reference the different VIPs, in a similar fashion to how someone might c

Re: Monitoring http returns

2018-04-11 Thread Peter Booth
connections, cache hit ratios etc is important to understand “what is normal?” It’s easy for our mental model of how a site works to differ markedly from reality. Sent from my iPhone > On Apr 11, 2018, at 2:04 AM, Jeff Abrahamson wrote: > >> On Wed, Apr 11, 2018 at 01:17:14AM

Re: Monitoring http returns

2018-04-11 Thread Peter Booth
will cause google and bing and other search engines to scrape in a pathological manner Sent from my iPhone > On Apr 11, 2018, at 2:04 AM, Jeff Abrahamson wrote: > >> On Wed, Apr 11, 2018 at 01:17:14AM -0400, Peter Booth wrote: >> There are some very good reasons for do

Re: Monitoring http returns

2018-04-10 Thread Peter Booth
Jeff, There are some very good reasons for doing things in what sounds like a heavy inefficient manner. The first point is that there are some big differences between application code/business logic and monitoring code: Business logic, or what your nginx instance is doing is what makes you mon

Re: Nginx throttling issue?

2018-04-04 Thread Peter Booth
John, I think that you need to understand what is happening on your host throughout the duration of the test. Specifically, what is happening with the tcp connections. If you run netstat and grep for tcp and do this in a loop every say five seconds then you’ll see how many connections peak get

Re: Nginx throttling issue?

2018-03-26 Thread Peter Booth
You’re correct that this is the ddos throttling. The real question is what do you want to do? JMeter with zero think time is an imperfect load generator- this is only one complication. The bigger one is the open/closed model issue. With you design you have back ptesssure from your system under

Re: Nginx 1.12.1 Memory Consumption

2018-03-19 Thread Peter Booth
processes. > > Do you have any suggestions for differentiating between the two issues that > might prevent memory from being returned to the system? > > Thanks! > >> On Thu, Mar 15, 2018 at 1:06 PM Peter Booth wrote: >> Two questions: >> >> 1. how a

Re: Nginx 1.12.1 Memory Consumption

2018-03-15 Thread Peter Booth
Two questions: 1. how are you measuring memory consumption? 2. How much physical memory do you have on your host? Assuming that you are running on Linux, can you use pidstat -r -t -u -v -w -C “nginx” to confirm the process’s memory consumption, and cat /var/meminfo to view a detailed descrip

Re: Using the mirror module

2018-03-14 Thread Peter Booth
Suggestion: Define two more locations - one that proxies www.example.com and another that proxies staging.example.com. If both locations work then your problem is probably mirroring. If one doesn’t work then the issue is your configuration and not mirroring. Either way you have reduced the size

Re: Using the mirror module

2018-03-13 Thread Peter Booth
This is the point where I would jump to using the debug log. You need to build you nginx binary with —with-debug switch and change the log level to debug innginx.conf. Debug generates a *huge* amount of logs but it really is invaluable. I would also want to double check what is actually happen

Re: location blocks, and if conditions in server context

2018-03-07 Thread Peter Booth
I agree that avoiding if is a good thing. But avoiding duplication isn’t always good. Have you considered a model where your configuration file is generated with a templating engine? The input file that you modify to add/remove/change configurations could be free of duplication but the conf fi

Re: fsync()-in webdav PUT

2018-02-28 Thread Peter Booth
This discussion is interesting, educational, and thought provoking. Web architects only learn “the right way” by first doing things “the wrong way” and seeing what happens. Attila and Valery asked questions that sound logical, and I think there's value in exploring what would happen if their s

Re: Files still on disc after inactive time

2018-02-16 Thread Peter Booth
100GB of cached files sounds enormous. What kinds of files are you caching? How large are they? How many do you have? If you look at your access log what hit rate is your cache seeing? Sent from my iPad > On Feb 16, 2018, at 3:16 AM, Andrzej Walas > wrote: > > After this inactive logs I have

Re: Response Header IF statement problem

2018-02-14 Thread Peter Booth
I think that part of the power and challenge of using nginx’s caching is that there are many different ways of achieving the same or similar results, but some of the approaches will be more awkward than others. I think that it might help if you could express what the issue is that you are try

Re: Suggestions for web apps to test out nginx load balancing?

2018-01-26 Thread Peter Booth
The tech empower web framework benchmark is a set of six micro benchmarks implemented with over 100 different web frameworks. It’s free, easy to setup, and comes as prebuilt docker containers. Sent from my iPhone > On Jan 26, 2018, at 2:27 PM, leeand00 wrote: > > Does anyone have a suggestion

Re: How to correctly dedicate server processes to specific CPU cores?

2018-01-22 Thread Peter Booth
So some questions: What hardware is this? Are they 16 “real” cores or hyper threaded cores? Do you have a test case setup so you can readily measure the impact of change? Many tunings that involve numa will only show substantial results ion specific app What does cat /proc/cpuinfo | tail -28 ret

Re: 2 of 16 cores are constantly maxing out - how to balance the load?

2018-01-11 Thread Peter Booth
Perhaps you should use pidstat to validate which processes are running on the two busy cores? > On Jan 11, 2018, at 6:25 AM, Vlad K. wrote: > > On 2018-01-11 11:59, Lucas Rolff wrote: >> Now, in your case with php-fpm in the mix as well, controlling that >> can be hard ( not sure if you can pin

Re: 504 gateway timeouts

2018-01-09 Thread Peter Booth
gs worked. They did. However they do not have the same >> effect for nginx installed on my production Ubuntu 16.x servers. I did not >> realize that these settings were limited by the OS that nginx is installed >> on. Are there are similar settings that will work for the Ubuntu

Re: 504 gateway timeouts

2018-01-04 Thread Peter Booth
Wade, I think that you are asking “hey why isn’t nginx behaving identically on MacOS and Linux when create a servlet that invokes Thread.sleep(30) before it returns a response?.” Am I reading you correctly? A flippant response would be to say: “because OS/X and Linux are different OSes th

Re: nginx latency/performance issues

2018-01-04 Thread Peter Booth
Are you running apache bench on the sam for different host? How big is the javascript file? What is your ab command line? If your site is to be static published (which is a great idea) why are you using SSL anyway? > On 4 Jan 2018, at 6:12 PM, eFX News Development wrote: > > Hello! Thanks for

Re: Can Nginx used as a reverse proxy send HTTP(s) requests through a forward proxy ?

2017-12-06 Thread Peter Booth
Take a look at the stream directive in the nginx docs. I’ve used that to proxy an https connection to a backend when I needed to make use of preecisting SSO Sent from my iPhone > On Dec 6, 2017, at 5:47 PM, Nicolas Legroux wrote: > > Hi, > > I'm wondering if it's possible to do what's descri

Re: simple reverse web proxy need a little help

2017-12-06 Thread Peter Booth
First Step Use something like http://www.kloth.net/services/nslookup.php To check the IP addresses returned for all six names (with and without www for the three domains) Do these look correct? Sent from my iPhone > On Dec 6, 2017, at 5:27 PM, qwazi wrote: > > I'm new to nginx but needed a

Re: How to control the total requests in Ngnix

2017-12-04 Thread Peter Booth
017, at 1:11 AM, Peter Booth wrote: > > I’m a situation where you are confident that the workload is coming from a > DDOS attack and not a real user. > > For this example the limit is very low and nodelay wouldn’t seem appropriate. > If you look at the techempower benchmark res

Re: How to control the total requests in Ngnix

2017-12-03 Thread Peter Booth
I’m a situation where you are confident that the workload is coming from a DDOS attack and not a real user. For this example the limit is very low and nodelay wouldn’t seem appropriate. If you look at the techempower benchmark results you can see that a single vote VM should be able to serve ov

Re: How to control the total requests in Ngnix

2017-11-30 Thread Peter Booth
So what exactly are you trying to protect against? Against “bad people” or “my website is busier than I think I can handle?” Sent from my iPhone > On Nov 30, 2017, at 6:52 AM, "tongshus...@migu.cn" > wrote: > > a limit of two connections per address is just a example. > What does 2000 reque

Re: Moving SSL termination to the edge increased the instance of 502 errors

2017-11-29 Thread Peter Booth
There are many things that *could* cause what you’re seeing - say at least eight. You might be lucky and guess the right one- but probably smarter to see exactly what the issue is. Presumably you changed your upstream webservers to do this work, replacing ssl with unencrypted connections? Do y

Re: Nginx cache returns MISS after a few hours, can't be set up to cache "forever"

2017-11-28 Thread Peter Booth
Can you count the number of files that are in your cache and whether or not it's changing with time? Then compare with the number of unique cache keys (from your web server log) When the server starts returning a MISS - does it only do this for newer objects that haven’t been requested before? D

Re: Issue with flooded warning and request limiting

2017-11-20 Thread Peter Booth
FWIW - I have found rate limiting very useful (with hardware LB as well as nginx) but, because of the inherent burstiness of web traffic, I typically set my threshold to 10x or 20x my expected “reasonable peak rate.” The rationale is that this is a very crude tool, just one of many that need to

Re: Nginx dynamic proxy_pass keeps redirecting to wrong domain

2017-11-16 Thread Peter Booth
You need to understand, step-by-stp, exactly what is happening. Here is one (of many) ways to do this: 1. Open the Chrome browser 2. Right click on the background and select inspect, this will open the developer tools page 3. Select the tab “Network” which shows you the HTTp requests issued for

Re: Does anyone know how to configure the session inactivity timeout in Nginx ?

2017-11-10 Thread Peter Booth
This is true in general, but with a single exception that I know of. It’s common for nginx to proxy requests to a Rails app or Java app on an app server and for the app server to implement the session logic This is an open-resty session implementation that sits within the nginx process. https:/

higher precision timings [ Re: why delta only include the execution time of ngx_process_events not ngx_event_process_posted (Zhang Chao)

2017-10-31 Thread Peter Booth
I think that this discussion touches on another question - are millisecond timings still sufficient when monitoring web applications? I think that in 2017, with the astounding increases in processing power we have seen in the last decade, millisecond timings are too imprecise. The cost of capt

Re: Performance issue of "ngx_http_mirror_module"

2017-10-27 Thread Peter Booth
There are a few approaches to this but they depend upon what you’re trying to achieve. Are your requests POSTs or GETs? Why do you have the mirroring configured? If the root cause is that your mirror site cannot support the same workload as your primary site, what do you want to happen when yo

Re: E3-1240 with 32GB Ram - Unable to set the optimal value for the server

2017-10-17 Thread Peter Booth
Agree, I work as performance architect , specializing in improving the performance of trading applications and high traffic web sites. When I first began tuning Apache (and then nginx) I realized the the internet was full of “helpful suggestions” about why you should set configuration X to thi

Re: E3-1240 with 32GB Ram - Unable to set the optimal value for the server

2017-10-16 Thread Peter Booth
w many milliseconds are spent building every request See https://lincolnloop.com/blog/tracking-application-response-time-nginx/ <https://lincolnloop.com/blog/tracking-application-response-time-nginx/> It’s better that you email me off-list for further discussion Peter peter _ booth @ m

Re: E3-1240 with 32GB Ram - Unable to set the optimal value for the server

2017-10-16 Thread Peter Booth
Agree, Can you email me offline. I might have a few ideas on how to assist. Peter peter _ booth @ me.com > On Oct 16, 2017, at 3:55 PM, agriz wrote: > > Sir, > > Thank you for your reply. > > This is a live server. > It is an NPO (non profit organisation). &g

Re: E3-1240 with 32GB Ram - Unable to set the optimal value for the server

2017-10-16 Thread Peter Booth
You said this > On Oct 16, 2017, at 3:30 PM, Peter Booth wrote: > > If i change the values, it hangs with 3k or 5k visitors. > This one handle 5k to 8k what hangs? the host or the nginx worker processes or the PHP or the mysql? You need to capture some diagnostic information over

Re: E3-1240 with 32GB Ram - Unable to set the optimal value for the server

2017-10-16 Thread Peter Booth
Advice - instead of tweaking values, first work out what is happening, locate the bottleneck, then try adjusting things when you have a theory First QN you need to answer: For your test, is your system as a whole overloaded? As in, for he duration of the test is the #req/se supported constant?

Re: Reverse cache not working on start pages (solution founD)

2017-10-12 Thread Peter Booth
Sounds like the problem is that you don’t have nginx configured to enforce canonical urls. What do I mean by this? Imagine that every page on the site has one and only one “correct URL” So someone might type http://www.mydomain.com http://mydomain.com http://www.mydomain.com/index.html and

Re: Multiple upstream_cache_status headers in response in a dual-cache configuration

2017-10-06 Thread Peter Booth
Why do you want to "realize a distributed caching layer based on disk-speed and storage?” Providing that you are running nginx on a healthy host running linux then your HDD-cache be faster (or the seem speed) as your SSD-cache. This because the cached file will be written though the Linux p

Re: Nginx splitting one single request's into multiple requests to upstream. (version 1.13.3)

2017-10-04 Thread Peter Booth
I can say that Maxim's idea of using tcp proxying with the streams module Is very simple to configure - just a couple of lines, and tremendously useful. Sent from my iPhone > On Oct 4, 2017, at 3:24 PM, pan...@releasemanager.in > wrote: > > Maxim, > > totally agree on your statement and op

Re: Reverse cache not working on start pages

2017-10-04 Thread Peter Booth
I found it useful to define a dropCache location that will delete the cache on request. I did this with a shell script that I invoked with lua (via openresty) but I imagine there are multiple ways to do this. Sent from my iPhone > On Oct 4, 2017, at 11:39 AM, Maxim Dounin wrote: > > Hello! >

Re: Nginx splitting one single request's into multiple requests to upstream. (version 1.13.3)

2017-09-26 Thread Peter Booth
Pankaj, I can’t understand exactly what you are saying. But I’m confident that here will be a way for nginx to work for you, providing you ask the question in a clear, unambiguous fashion. Is your application behind nginx, such that nginx is POSTING to the app? Or is your application making th

Re: ngx_slab_alloc() failed: no memory in cache keys zone

2017-09-20 Thread Peter Booth
Lots of questions: What are the upstream requests? Are you logging hits and misses for the cache - what's the hit ratio? What size are the objects that you are serving? How many files are there in your cache? What OS and what hardware are you using? If it's Linux can you show the results of the f

Re: Options for selective logging

2017-09-19 Thread Peter Booth
What is your ultimate goal? You say that you want to replay 0.05% of traffic into a test environment. Are you wanting to capture real world data on a one off or ongoing basis? You say that this particular proxy is very busy. How busy? Is it hosted on a physical host or a virtual machine? If

Re: Identifying "Writing" connections in status stub

2017-07-30 Thread Peter Booth
During a busier part of the day, what is your minimum, median,99%, max requests per sec? > On Jul 30, 2017, at 9:31 AM, Vlad K. wrote: > > >> If you open the status page in a browser do the numbers report match >> what you see with netstat? > > Waiting does: > > # netstat -n | grep -E "tcp4

Re: Identifying "Writing" connections in status stub

2017-07-30 Thread Peter Booth
See below > On Jul 30, 2017, at 6:12 AM, Vlad K. wrote: > > On 2017-07-30 11:26, Peter Booth wrote: >> I just reread the thread and realize that you answered q2, and that >> makes the graph even more >> surprising. You say that it son FreeBSD - does this mean t

Re: Identifying "Writing" connections in status stub

2017-07-30 Thread Peter Booth
descriptions for a specific pid? > On Jul 30, 2017, at 5:15 AM, Peter Booth wrote: > > Vlad, > > You might not need to replicate it- you have it happening in production in > front of you. > Some questions: > > 1. When is the last time that your production nginx was

Re: Identifying "Writing" connections in status stub

2017-07-30 Thread Peter Booth
Vlad, You might not need to replicate it- you have it happening in production in front of you. Some questions: 1. When is the last time that your production nginx was restarted? 2. Do you have regular restarts? 3. Is there an obstacle to restarting at some point? 4. Is this a single instance or

Re: Identifying "Writing" connections in status stub

2017-07-26 Thread Peter Booth
Vlad, I'd suggest beginning by seeing whether or not this is real. If you create a cron job that invokes netstat -ant every hour, then summarize the connections and either view them manually or write them into an influxdb and graph with grafana you will see whether or not the #tcp connections r

Re: Disable NGINX caching 304 Responses from Origin Server

2017-07-26 Thread Peter Booth
g interesting and wondered if you could shed some light >> on it. >> >> Simply adding: >> proxy_ignore_headers Cache-Control Expires; >> >> Enables 304 responses from the origin server without setting: >> >> proxy_set_header If-Modified-Since $http_i

Re: Disable NGINX caching 304 Responses from Origin Server

2017-07-26 Thread Peter Booth
I can’t see an obvious issue, but I can say that there is no such thing as a simple web server setup where caching is involved. I have gray hairs that appeared after working with a high traffic retail website that had seven levels of caching (browser cache, CDN, hardware load balancer, nginx reve

Re: Specify a Vary: Accept-Encoding header

2017-07-24 Thread Peter Booth
run other tools. Peter > On Jul 21, 2017, at 6:58 AM, Peter Booth wrote: > > It looks as if the static content is being served by the Rails asset pipeline > rather than directly by nginx > and the impact is enormous. It took 25s for the base page - but it also took > anothe

Re: Specify a Vary: Accept-Encoding header

2017-07-21 Thread Peter Booth
It looks as if the static content is being served by the Rails asset pipeline rather than directly by nginx and the impact is enormous. It took 25s for the base page - but it also took another 25s for the http://cryonics.org.au/assets/application.js

Re: NGINX stale-while-revalidate cluster

2017-07-09 Thread Peter Booth
uest that arrive to Server 1 asking for URL1 will > receive the version of some hours before (not some minutes). This is what we > are trying to avoid. > > Many thanks for all your feedback and suggestions, > > > Joan > On 08/07/17 15:30, Peter Booth wrote: >>

  1   2   >