Two versions of same asp.net app using same server as stateserver - bad? - load-balancing

We have 2 production web servers for our web app, load balanced to handle lots of traffic.
We also have a similar setup for testing.
Test pool: [TEST 1]---[TEST 2]
Prod pool: [PROD 1]---[PROD 2]
When comparing the Web.Config of the app versions (test vs live) I discovered something surprising: both pools have the same value for stateConnectionString. If I understand right, this means they are using the same state server:
<sessionState
mode="StateServer"
stateConnectionString="tcpip=123.123.123.123:42424"
cookieless="false"
timeout="30"/>
Is this a problem? (How does the state server not confuse the two pools)?
I was having odd only-sometimes slowdown/errors on the test server, that's why I was looking at this in the first place, but the prod pool runs fine...

What this really means is that server 123.123.123.123 is the single source of all shared state for all servers on the web farm.
It's no different conceptually than storing the state in a centralized database, except in this case it's all stored on that one server in memory, and not a database.
I don't see anything wrong with it, per se..

Related

ASP.NET Core Data Protection Key stored to ContentRootPath does not work on different machines

I have Setup a Database for developing that is available in the local network.
I implemented the Dataprotection Api to encrypt some of the sensitive information of my models(Entity Framework), before saving it to the database.
In Startup I configured it like this:
var keysfolder = Path.Combine(Environment.ContentRootPath, "Keys");
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(keysfolder));
The Key is in the folder,not protected and shared in the repository because it is only for Test Data.
I can access the data in my app on 2 different Linux machines but on one Windows PC I get a Invalid Payload exception.
They share the same commit and use the same purpose strings.
So I must have failed to understand it. I thought that I can backup the keys and the database in production and redeploy, if necesarry on a different machine without loosing the data.
Can anybody explain why I canĀ“t use the key on the Windows PC?
I have a solution to this problem.
I found the answer here: https://techcommunity.microsoft.com/t5/iis-support-blog/system-security-cryptography-cryptographicexception-the-payload/ba-p/1919096
You have to call SetApplicationName when registering DataProtection:
services.AddDataProtection()
.SetApplicationName("MyApp")
.PersistKeysToFileSystem(new DirectoryInfo(keysfolder))

Where is the application pool meta data stored for IIS 6

In IIS 6 (Windows Server 2003R2), where is the metadata stored, particularly for application pools? I am experiencing some unexpected behavior when switching between two seemingly identical app pools (at least as far at the GUI displays), and would like to check the raw data to see if something is corrupt or incorrect.
All the IIS6 configuration is stored at C:\Windows\system32\inetserv\metabase.xml file and not in the users home directory.

unable to delete osb_server1 in the osb 10.3.6.0

There are scripts that build the admin server, then create clusters, managed servers, machines etc and when this domain is built, it is seen that an additional phantom server osb_server1 with port 8011, is getting built that isn't attached to any cluster or any machine.
This is built when the wlsb.jar was being referenced during one of the scripts.
Once after the admin server is up and running and we have other managed servers as well, Was trying to remove osb_server1 and this error creeps up
weblogic.management.configuration.AppDeploymentMBeanImpl.isCacheInAppDirectorySet()
Errors must be corrected before processding
There are like 120 default deployments on OSB that are targeted to osb_server1, was trying to retarget them to another server, but that is also throwing an error ...
Any ideas ???
That's due to the weird behaviour/bug of the standard osb template. There is a discussion here. http://theheat.dk/blog/?p=1255.
I didnt follow the steps given by Oracle(as in the URL). What I did was,
I keep the default osb_server1, and make it part of the cluster during the domain creation(ie, it's the first server). Once the domain is created, I re-set the osb_server1 to the desired value. That way the singleton services will still be deployed to the 1st server and others to cluster. Using WLST:
readDomain(domain_name)
cd('/Servers/osb_server1')
set('ListenPort', osb1_listen_port)
set('Name', osb1_name)
cd('/Servers/' + osb1_name + '/ServerDiagnosticConfig/osb_server1')
set('Name', osb1_name)
updateDomain()
closeDomain()

ASP.NET gurus - small issue when setting app domain name for sharing SQL session in scale-out scenario

We have scaled-out some portions of our ASP.NET app to run on one server, and other portions to run on another server (& under a subdomain).
The two servers share (SQL Server) Session. We used this MS article to create a tiny HTTP Module to sync app domain name between the two servers (sans the cookie domain code, which can be configured in the web.config. I later found this CodeProject article which is essentially the same.)
Everything's working well, except for a small issue: deployment changes or web.config tweaks require a manual app pool recycle (the auto-recycle no longer works - instead we get the "web server is currently unavailable / hit refresh" error).
I tried moving the app domain naming code from the HTTP Module into the Application_Start section of the Global.asax (maybe this is a better place for it?) - but received the same problem.
I know that one solution is to hard-code the app name in one of the SQL Server Session stored procedures; but am a bit hesitant to do this.
Edit: The app is ASP.NET 3.5 under IIS 6.0 (thanks #Chris & #bzlm)
You should check if proper Recycling Events are turned on in IIS, maybe this can help http://support.microsoft.com/kb/332088
Update. We opened a tech support case with Microsoft about this. After a week or so of back & forth, they said they had reproduced the issue in their environment and understand the cause (a timing issue deep inside the ASP.NET internals) - but that there is no resolution that they're aware of. I complained that the HTTP module is Microsoft code, but they said that this code is under "FAST PUBLISH" terms - intended to help & advise customers; yet not warranted.
Ah well. We now just manually recycle the app pool after making a web.config change.

WLST: deploy application but do not start it -- how?

I need to script an EAR deployment to Weblogic 9.2. Extra requirements I have though are:
Application Name shall be the one I provide, not just EAR name
Application is deployed in Prepared state, not Running one
As far as I can tell, when I use deploy(), the name is got assigned by me (good!), but application starts right away (bad! other services are not ready yet!).
Can anyone point me to a correct way of doing that?
I think that what you're looking for is distributeApplication, not deploy (also see Administration Mode for Isolating Production Applications).
For the application name, why don't you set it in the deployment descriptor?