How to prevent logging out / losing screen after closing RDP - windows-server

I have an application that performs click on screen that's running on Windows 2019 Server instance
but the thing is that when I close RDP, then application stops working (clicking)
I suspect that this is caused by User logging out when I close RDP (using "X" button).
Is there any way to "don't lose screen" when I close RDP?

by using the "X" button on your RDP session you do not get logged off. You will be disconnected and your user session is still there. Anyway there is a Windows-GPO that can be used to set a time limit on disconnected sessions.
Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Session Time Limits
There should be a setting Set time limit for disconnected sessions. Check if it is Not Configured or Enabled with Never.
If this does not solve your Problem it is probably a problem with the application that needs a connected User Session.
Greetings.

Related

Log DB connections opening and closing with Laravel

I have a Laravel app where I've encountered a [1040] Too many connections error a few times over the past few weeks. I'm very surprised because my max_connections is at the default value (151), and Google Analytics shows I haven't had more than 30 users on the website at the same time..
I'm struggling to debug where the issue might come from. I'm thinking a starting point would be to monitor when Laravel opens and closes connections to the database, to see if I can identity connections that remain open longer than they should.
Is there a way to detect when Laravel actually opens/closes a connection?
(Any other idea on how to find where the issue comes from is also welcome!)

How to force close Access application when user lost connection to back-end

The Question:
Is there some way to force close access so it doesn't need access to the back-end server in order to exit?
The Situation:
I have an Access 2016 DB. The back-end is on a networked share drive which is only accessible when connected to the lan or on VPN. On load there is a ping test to the server, if found it copies the tables to local tables, if not, it just tells the user can't connect and continues on using the old data. The users travel a lot and can't always be on the VPN so the idea is that the data they have isn't more than a few days old. BTW, did I mention the users are only consumers of information and not contributors so I don't care that they can't write to the back-end. The tables contain a few 100k records, the application just puts it in nice easy to search and cross-reference reports.
The Problem:
While this loads and runs really nicely regardless of them being connected to the lan or not, it will NOT close if they don't have a connection to the server. It doesn't produce an error which I could easily handle, it just hangs. Task Manager won't even close it.
Attempted Solutions:
I tried to unlink the tables and just use a temporary connection to the backend to load the tables when I need them at the beginning, however this meant the user was prompted by the Microsoft Trust Center about 8 times every single time they loaded this unless I have each of them actually open the back-end DB themselves, give them the password to do that, and none of that is practical.
Access doesn't play well with remote BE..if you want to be on the Remote Side with Access you have 2 options :
Connect via RDS..the user connects to the server via Remote Desktop ..everything is "local" ..so now issues on lost connections ...as long the RDP connection hold everything is smooth and more importantly you don't have BE disconnects that cause corruption or loosing data (hint : Using the RemoteApp technology it will seem to the end user like he/she is working locally...i am using it and its great)
Switch BE...as i said , is not wise to use Access BE via remote connection..in order to do that switching to MsSQL/MySQL/PostGre ...etc will give you the true remote connection capability
After playing with all the settings for a few days, I finally figured out what my problem was.
In an effort to test different settings to see if I could reduce file size at one point I turned on "clear cache on exit" in the Current Database settings. Turning this off fixed the problem. I had forgotten that was on, so it turned out to not be a programming issue after all.

Connections Option in RDS Mysql and best way to handle many connections

In the below image it shows current activity as 99 Connections.
How exactly it is counted.
RDS is accessed through node.js webservices, php website. Every time I do some operations I close the connection. So once after closing it doesn't decrease rather it keeps increasing. Later I got the too many connections error message once the connections became 608. I restarted then it works. I never seen it decreasing.
So what is the best way I can handle it.
Below is the image which is showing when I run SHOW FULL PROCESSLIST;
PHP-based web pages that use a MySQL connection generally exit as soon as they're done rendering page content, so the connection gets closed whether you explicitly call a mysqli or PDO close method or not.
The same is not true of Node services, which run for a long time and can therefore easily leak resources. It's probable that you're opening connections, but not closing them, in your Node service, which would produce the sort of behavior you're seeing here. (This is an easy mistake to make, especially for those of us whose background is largely in more ephemeral PHP scripts.)
One good way to identify the problem is to connect to the MySQL instance via Workbench or the console monitor and issue SHOW FULL PROCESSLIST; to get a list of currently active connections, their originating hosts, and the queries (if any) they are executing. This may help you narrow down the source of the leaking connections, so that you can identify the code at fault and repair it.

websocket never close, transfer multiple data

I have builted a web app. I send and receive a lot of data using Websockets and each time I have to open and close a Websocket connection.
Why dont avoid the constant open/close? How about when the page loads, Websockets are created and opened and they never close, so I use the same Websockets to send and receive text, arrays, links, search queries etc. I am even thinking about transfering files like images and/or videos via Websockets.
Can I do this , or do I have to close a WS connection after I am done? Will never-closing WS rise a security issue? Plus I dont know if the WS will actually close when the user leaves the page. If it does not, I guess that is another security issue, right there.
How do I transfer files via WS? I cannot imagine how to do this
Thanks in advance
Websockets are meant to remain open for the lifetime of the webpage or SPA... it's totally expected normal behavior.
The server might close the websocket at any time and this is also normal behavior - just re-open the websocket.
Normally, servers will only close the websocket if the websocket was idle for a some time (i.e. Heroku set the timeout limit to 50 seconds) or for traffic and concurrency considerations. Otherwise, the websocket connection could remain open for all time.
For example, the Plezi framework (Ruby) sends a pong frame automatically every once in a while, so the connection will remain open indefinitely unless the browser closes the socket (usually by exiting the page).

php/mysql maximum connections reached

I have an application that connects to a 3rd party. They fire web-hooks simultaneously at a time. Sometimes the hooks are about 1000 and over. The problem is that, my script connects to a database and save the hooks. These 1000 queries fired simultaneously on my system makes the system goes off. How effectively can i handle the web hooks?
thanks.
What you can do is, after every query, is close the connection. This will ensure that no connection stays open or is stacked on top of each other.
You will have to re-initiate the connection before launching a new query of course.
You could also increase the number of connection allowed to your MySQL database. This should be changed in your MySQL configuration (usually at /etc/mysql/my.conf ( http://dev.mysql.com/tech-resources/articles/mysql_intro.html )) by changing the "max_connections" variable/configuration value. ( http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_connections )
Good luck and if you have any questions don't hesitate to ask.
Best regards,