First time File.Copy operation is slow on AWS EC2 Windows Server 2008 - windows-server-2008

On Amazon (AWS) EC2 Windows Server 2008
This line of C# code
File.Copy(file1, file2);
is executed first time about a minute, when repeated - in no time
Any ideas?

Related

SQL Server Agent (SQLEXPRESS) automatically stop

I'm encountering a problem on Microsoft SQL Server. SQL Server Agent is not running, when I tried to start it and refresh the services.msc the SQL Server Agent is not running anymore. When I see the logs on event viewer. There are no errors but a message "SQLServerAgent service successfully stopped"
Here is the log.
SQLServerAgent service successfully started
SQLServerAgent service successfully stopped.
SQLEXPRESS does not include the SQL Server Agent aspect of the product.
You need to have SQL Server Standard Edition (or greater) to get the SQL Server Agent functionality.
That said, there may be other ways to achieve the results you desire. You could build a simple .NET app or PowerShell script to execute your query or stored procedure, and schedule that to execute via Windows own task scheduler. It is in many ways not as robust as SQL Server Agent, but it is also not as restrictive (you're running under a Windows process as opposed to SQL Server, so you have more options as to how the application may work).

WCF service slow after host renamed

Windows Server 2012 R2 / IIS 8.5 / net.tcp
Trying to replace 2008 R2 in my environment by setting up 2012 R2 servers and copying app folder to new server, create IIS site and create each WCF app under the site. Once ready, test and replace server by renaming hosts.
The WCF time for a single function goes from ~2 seconds to load to ~10 seconds or more after only renaming the host.
Using localsystem for each pool being used. Renaming the 2008 R2 server doesn't show to be effected by a rename. I tried other built-in users with no change.
IIS console shows correct hostname, searched registry for any cached (lsa has cached value that shows correct hostname).
I have 30+ 2012 R2 servers running the same, only difference is they were not renamed after setup.
Try to increase worker process for the designated application pool. Following is an example for your DefaultAppPool. But you might need to change it for your own app pool which isolate your wcf service.

Restart a remote windows service using batch file

Haloo all,
I am having couple of windows services running at different Servers which will execute at predefined set of time periods.
Some times it may happen that service is not functioning as desired, then I will go and restart that particular service. After that it will start functioning.
Currently using SQL Stored Procedure and SQL Jobs every 30 mins system will be checking whether the service is functioning or not and if it is not functioning then it will trigger a dbmail to my ID as a notification. (There is a table in my data base in that I will be getting the last executed date and time).
My question is, is there any way like.....using the SQL job I can restart these windows service directly...using a batch file or something...Please note that the SQL database is not on the same server in which the Windows service is running....But all these servers are connected by WAN.
Yes, create a bat file that does a "stop" or "restart" or "start" for the services you want . "sc \servername stop servicename" or "sc \servername start servicename" or "sc \servername restart servicename". This bat file can be executed remotely or directly on the server, you can then call this bat file using a sql job or using a windows task scheduler. Back in the day, all of our server management was done using VBScript or DOS, via bat files.

Windows Integrated account is slow to connect to the SQL server database.

I have a SQL server that belongs to a domain and an application server that is stand alone. Of course it has the right ROUTES to reach the sql server.
when I use a test.udl file to test the connection, a sql login would work right away. But if we try a windows integrated account (servername\username) it takes about 25 seconds to connect.
Unfortunately I have MSMQ running on that server and application that has to take these messages and send it to the SQL server. Because of the delay (I think) MSMQ keeps all its messages.
Do you know what could be the reason for this delay only on WIndows integrated logins?
Note that, I have windows firewall disabled on these servers, No Antivirus.
SQL Server 2008 R2.
Application Server - Windows 2008 R2
Thanks for your time,
RM

SQL Azure: Timeout expired

we have some cloud Services hosted in Windows Azure and also some Azure SQL database. At night (during 4:00 - 6:00 utc) there are running some Jobs to import data into database. Since some weeks all the Jobs fails with an timeout expired exception of the database. If I run the Jobs later (during 7:00 - 9:00 utc) on my local machine within the Emulator, all Jobs work without any Problems on the same database.
At the mport time is no much traffic from our site on the database server. The monitoring of the manage portal shows that there are not many open Connections, no throttled ones and no connection errors. There are much more traffic during my local runs.
The sys.event_log do not contains any errors or other possible issues.
Are there any logs or other Options to get more Information about why the Jobs failed at night?
Update
It seems, that the SQL Azure Server ignores the command timeout property. The Jobs start at 4:30 UTC and stops with an timeout exception at 4:37. But the query, which gets an timeout, has an command timeout of 1200 (20 minutes). And before starting the command, there are some downloads from an ftp-server, file parsing and other SQL queries.
Just to note that SQL Azure isn't a full version of MS SQL and does have some limitations. Most notable limitation is the infrastructure that its built on. Your SQL Azure DB will be hosted on a Small Instance server that has shared resource with hundreds of other users. Although there is a fair use policy on the machines it does take time for the servers to kick in.
My suggestion would be to have some way of determining if the Job is actually starting or if the connection pool is timing out prior to starting the job. I.E. create a jobs table that is inserted into to say its started and have this as the first action on your job.
Alternatively you could think about migrating to a VM setup in Azure. This is where you have a Small or Medium instance VM with a fully fledged version of MS SQL Server running on it. That way you can run your jobs against the server correctly and control you connection pooling more appropriately.