Jmeter loadtesting with nginx - nginx

I have done jmeter load testing and it was working fine.
Now i am doing jmeter load testing with ngnix by configuring two server details .
I am testing my application by giving the 1000 concurrent users with nginx url.
Sometimes it was working and sometimes not.
Why it is behaving like that??

Check the logs — nginx logs, your app and server logs and JMeter logs. Probably you can find answer there:
Check nginx.conf and find error_log settings to get current nginx error log location.
What do you mean "sometimes not"? What kind of errors, statuses and responces do you get?
You may post in here.

Related

Alfresco unable to connect to server http://mydomain:8080/alfresco

i am running alfresco on linux server i am able to access the files from back end but when running http://mydomain:8080/ it gives the following error
Unable to connect
Firefox can’t establish a connection to the server at mydomain:8080.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
tomcat is running but i still cant figure out what could be the cause of the error.
Could you take a look to a tomcat logs?. Maybe you can find more information about the issue.
Could you check compatibility of your amps files with Alfresco version?
Regards,
clv
First, try to hit the Alfresco webapp from the local server itself using curl, like:
curl -v -uadmin http://localhost:8080/alfresco
And see what comes back. If you get a 200 or a redirect, try Share next, like:
curl -v http://localhost:8080/share
If you get a 200 or a redirect then both web applications are working fine and this is due to a network connectivity problem between your client machine and the server or a firewall issue.
If curl cannot hit one of the web applications locally, you should inspect the logs ($TOMCAT_HOME/logs/catalina.out) to figure out why.
You can also "ps -ef|grep tomcat" to make sure Tomcat is actually running, and you can "netstat -atnp|grep 8080" to make sure Tomcat is listening on the port you think it is.
If all of the firewall and networking tests are fine and the logs have no clues, uninstall the AMPs one-by-one until it starts working again.

Access website using server name instead of www

I am new to IIS, setting up servers and load balancer so please do not mind my ignorance.
I have an old website, say, www.mywebsite.com.
There are 3 IIS 6.1 web servers on which my ASP.NET code is hosted.
Lets call them web01, web02 and web03.
They are identical in configuration like OS, etc.
There is a load balancer which handles the requests coming in from the clients through www and routes it to the respective server based on whatever algorithm is put in place.
However, we were able to send requests directly to individual servers like this web01.mywebsite.com for all 3 servers.
I do not have access to the load balancer.
Recently there were some problems with the web02 server so the client took it out from the load balancer.
We then reinstalled IIS and now, when we are trying to access the server using web02.mywebsite.com, it is throwing 404 - Not Found error.
I am able to open the website from inside the server using www.mywebsite.com and I am able to see that the requests is catered by the web02 server.
However, from inside the server also web02.mywebsite.com is throwing 404 - Not Found error.
I am sure I am missing something in configuration at the IIS level but not able to figure out.
I tried searching on the internet but they all gave me generic solutions.
Please help.
Thanks in advance!
I was able to get this resolved on my own.
Strangely there was not a single answer or comment to this question.
I will try to answer so that others might also benefit.
There were 2 things that were required, out of which 1 was already present in my case:
In the hosts file, the mapping of IP address of the server to the actual name of the server should be present (This was there in my case)
In IIS, under bindings, I removed the host name i.e. www.mywebsite.com.
I was able to figure this through the posts here and here although they did not give the answer directly.
Hope this helps others.

Multipart PUT/POST timeout

I configured my gitlab instance with an external nginx server according this documentation and following nginx configuration.
All is working fine, but when i try to change some profile settings in the UI I get an connection reset.
The problem only occurs on multipart form POST/PUT operations.
The funny thing is, that there are no log entries in any gitlab log files, so i think there is a problem in the nginx configuration somewhere.
Please when someone has any idea on how to further analyse the problem.
Thanks
The problem was the MTU setting for the TCP-IP Stack on my windows machine. I switched from 1500 to 1300 and now all is working fine again.

502 error monitoring in Nginx server

I have a Linux server running Nginx and from time to time it starts throwing a 502 error when trying to access it throw HTTP, and after a while gets back to normal.
I've checked the different logs (Nginx, PHP and MySQL) and didn't find anything that could help me find what's causing this.
Any idea where I should look or if it's possible to set any logging/monitorinh tool to help me out?
Thanks,
502 is a Bad Gateway error. You may want to use a log monitoring tool to see these types of errors. You may also want to send the PHP errors to see if they are generating fatal errors at the same time. I personally use Loggly for this purpose, but you can use other tools available in the market.
Also, I would recommend logging Nginx as JSON, and adding to the normal metrics, the uptime for the upstream servers, so that you can see if the 502 errors are also correlated with deteriorating performance.
If you haven't read this already, I recommend starting here:
https://www.nginx.com/resources/admin-guide/logging-and-monitoring/

Should I always use a reverse proxy for a web app?

I'm writing a web app in Go. Currently I have a layout that looks like this:
[CloudFlare] --> [Nginx] --> [Program]
Nginx does the following:
Performs some redirects (i.e. www.domain.tld --> domain.tld)
Adds headers such as X-Frame-Options.
Handles static images.
Writes access.log.
In the past I would use Nginx as it performed SSL termination and some other tasks. Since that's now handled by CloudFlare, all it does, essentially, is static images. Given that Go has a built in HTTP FileServer and CloudFlare could take over handling static images for me, I started to wonder why Nginx is in-front in the first place.
Is it considered a bad idea to put nothing in-front?
In your case, you can possibly get away with not running nginx, but I wouldn't recommend it.
However, as I touched on in this answer there's still a lot it can do that you'll need to "reinvent" in Go.
Content-Security headers
SSL (is the connection between CloudFlare and you insecure if they are terminating SSL?)
SSL session caching & HSTS
Client body limits and header buffers
5xx error pages and maintenance pages when you're restarting your Go application
"Free" logging (unless you want to write all that in your Go app)
gzip (again, unless you want to implement that in your Go app)
Running Go standalone makes sense if you are running an internal web service or something lightweight, or genuinely don't need the extra features of nginx. If you're building web applications then nginx is going to help abstract "web server" tasks from the application itself.
I wouldn't use nginx at all to be honest, some nice dude tested fast cgi go + nginx and just go standalone library. The results he came up with were quite interesting, the standalone hosting seemed to be much better in handling requests than using it behind nginx, and the final recommendation was that if you don't need specific features of nginx don't use it. full article
You could run it as standalone and if you're using partial/full ssl on your site you could use another go http server to redirect to safe https routes.
Don't use ngnix if you do not need it.
Go does SSL in less lines then you have to write in ngnix configure file.
The only reason is a free logging but I wonder how many lines of code is logging in Go.
There is nice article in Russian about reverse proxy in Go in 200 lines of code.
If Go could be used instead of ngnix then ngnix is not required when you use Go.
You need ngnix if you wish to have several Go processes or Go and PHP on same site.
Or if you use Go and you have some problem when you add ngnix then it fix the problem.

Resources