How to fix too many connection request call to ejabber server? - ejabberd

Facing too many connection calls while trying to connect my react application with Ejabberd server. I am using strophe library for the connection between React end to Ejabberd server
Due to this problem, Ejabber server blocked some amount of time and unblocked after some time.
Error message in Ejabber while too many connections "Too many requests from the same IP"

Related

Closing a DB connection after API Request ends. Laravel RDS MySQL Database

We are working on a application that is being used on large scale.
the app is hosted on the AWS architecture with (Ubuntu API Instances with RDS Database)
So when we do a load test on the API using jmeter we face issues on 10K users as it shows Gateway time out issues on few request.
after debuging a requests and servers
we came to know that the Server capabilities are hitting 60% CPU only but the database connection limit's are reached
So we are now on increasing database connection capabilities but increasing db connection will have cause DB CPU reach 90% and it wil not work efficiently on all request coming
So we are thinking to disconnect the connection to databse after each api request being complete3d
for example
API : Get User
So once the api is being hit and result being returned it will disconnect the database connection of the request.
so in this case it will keep cloing connection for request once the response is being served
So the closing connection is a good practice ?

SQLException when deploying ASP.NET Boilerplate application to Azure

I've been trying to deploy an ASP.NET Boilerplate application to Azure for the last couple of days and I haven't been able to do so. I keep stumbling upon this error:
First I make a Web App + SQL resource and then publish my project to it from inside Visual Studio using the right click -> deploy option, and then importing the publication profile I got from Azure. I make sure the database connection string in the appsettings.production.json are correct but I can't seem to connect to the database. If I try to connect to the database through the SQL Server Management Studio I get a similar error. This means something is wrong with the database itself.
Do I need to create a separate SQL database in Azure that makes use of the SQL database server that comes with the Web App + MySQL resource?
Any help would be greatly appreciated! I have been spending way too much time on this problem already.
This is a screenshot of all the resources in the Azure portal, these were created while creating the Web app + MySQL resource:
Edit: This is the error I am getting:
Win32Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Unknown location SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e) InvalidOperationException: An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call. Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute<TState, TResult>(TState state, Func<DbContext, TState, TResult> operation, Func<DbContext, TState, ExecutionResult<TResult>> verifySucceeded) Win32Exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Since you mentioned you can't access db in any other way, I provided step-by-step instruction
You can get your connection string from Azure resource panel
Navigate to Connection security tab and enable access from other Azure resources. This way WebApp will be able access database server inside Azure network. I also added my client IP to test db connection from my PC later. Click Save at the top when you are done
On the same page there is setting called configure SSL connection. Certificate can be downloaded from https://learn.microsoft.com/uk-ua/azure/mysql/howto-configure-ssl. I used this file https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem . Optionally, you could disable this feature for now.
Now we have everything to test db connection. I will show it with the use of HeidiSQL client.
Click open and see your databases
According to this you need to have CACertificateFile parameter appended to connection string to use SSL, so you need to put file into repository and provide its relative path in connection string
This was all caused by a stupid mistake, in the Azure portal I selected the Web App + MySQL resource instead of the Web App + SQL resource. For the ASP.NET Boilerplate project I am using you need a Web App + SQL resource.

Connect Timeout Error on cloudhub : Mule version:4.2.2

I am trying to hit an https client api which is working fine on postman(gives response in 800ms) and in local mule flow but it is not working fine on cloudhub . I am getting Connect Timeout error. It tries connecting for 30 secs(as per logs) and then gives HTTP:CONNECTIVITY error.
failed: Connect timeout.
errorType=HTTP:CONNECTIVITY
cause=org.mule.extension.http.api.error.HttpRequestFailedException
Response Timeout that I have set is 5 mins.
The flow was working fine when deployed on cloudhub before.It stopped working a few days ago though I didn't make any changes to my code.I am unable to debug this issue as it is not reproducible on my local env(it works perfectly). Any help would be appreciated.
There are 4 different types of general timeouts mule HTTP calls offer. Each has its own differences.
Connection Idle Timeout
Response Timeout
Max Idle Timeout
Query or Transactions Timeout ( Applies for DB Connectors)
Since you are getting
HTTP:CONNECTIVITY ERROR.
Applying a 5 min Response Timeout doesn't help.
Response Timeout (means taking longer time to respond) should be worried only after Establishing a Connection Handshake.
Your problem is with the Connection itself.
The only possible way you could try fixing this is by Applying a Connection Idle Timeout and a Reconnection Strategy with some frequency gaps.
Since you are so sure about tests in local. I suggest you the below two steps:
1. Try using the same HTTP connector configuration in a separate new mule APP. Try with a simple listener and the failing requestor. Also add one more freely available online REST services into your code in other extra flow. Now try to test both. See which one is working and which is failing.
This would tell if it's a real HTTP CONNECTIVITY problem or anything else related to some mule bug.
2. Check your configurations once again and make sure if your hitting the same endpoint in the cloudhub version.
Finally, I hope you did not accidentally put any proxy conf in the local version.
If it was working, probably there was a networking change in the other side that prevents access from the CloudHub application. You didn't share the URL so it is not clear if it is an internal host or a public host. We also don't know if there is some kind of whitelisting on the server side.
You can test connectivity to the HTTP host and port using the Network Tools application, to see if it accessible from your CloudHub environment.

WebLogic Bridge Message: "Failure of Web Server bridge: No backend server available for connection..."

I have an application (packaged software from a vendor) that runs on Oracle WebLogic.
There are few operations that, if I try them, I consistently get the following error page:
(WebLogic Bridge Message) Failure of Web Server bridge: No backend server available for connection: timed out after 10 seconds or idempotent set to OFF or method not idempotent.
The error occurs consistently almost exactly five minutes after I try the operation.
The page does not look like the typical error page you get when the application logic fails. It looks like something to do with the infrastructure (e.g., WebLogic configuration).
I am pursuing the issue with the software vendor, but that's not going well.
Has anyone seen this message and/or suggest an approach for diagnosing the root cause here?
Looks like you are using a Proxy Server between Browser and Weblogic Server. By seeing the error it's evident that proxy server unable to connect to back-end WLS server. You may have to enable proxy debugs to get more info.

Connecting to a local SQL server from a website

We have a small network behind a firewall (WatchGuard XTM 2 series) and network switch. On our network we have multiple instances of SQL server, but 1 in specific that I would like to be able to access remotely from our website. We have a static IP address from our ISP and then all the machines on the network have a locally assigned dynamic IP address. When trying to connect to the database from outside our network how do I get the request to be directed to the proper machine / SQL instance? Is it a parameter in my connection string or something in my firewall?
A few things to rule out:
1) The firewall is allowing access from the website to our network. I added the site's IP and opened up port 1433. Also, when trying to connect and monitoring the firewall no exceptions come up as they did before I added the proper IP address.
2) Remote connections on the SQL server has been setup and enabled. I've done a lot of reading up on remote connections and I am sure it has been setup properly.
I am currently getting this error message on my site:
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: TCP Provider,
error: 0 - A connection attempt failed
because the connected party did not
properly respond after a period of
time, or established connection failed
because connected host has failed to
respond.)
The Server parameter of the ConnectionString indicates what server to connect to. Assign an ip address or URL to the server that you want to access and put that in your connection string.