Click here to Skip to main content
15,916,949 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My server is Windows 7 only running on a 2.8 GHz Quad Core process.I have a website application running ASP.NET using IIS7 . The application has only 1 worker process defined under it because I use session state of the webpage. My web application uses up to 1 to 36 threads per client. So when a user clicks on his webpage, 36 threads are spawned. I am noticing that some of the threads are not executing. I foresee in the future that there could be as much as 80 users clicking on my website creating lets say (80* 1) to (80 *8 ) threads max if they submit at the same time(I took 8 as average instead of maximum 36). The thread functionality is necessary but the threads do not actually do much data handling.

How do i proceed? My options are the following from what I have read-

1. Increase the thread pool for each worker process. Don't exactly how to do that or if at all can be done. Please advice.

2. Use multiple worker processes. Then I will be forced to design another way to use session state using database because IIS7 cannot maintain session states between recycling.

3. Use multiple worker processes. Turn recycling off. Is recycling needed? Do not know. But I read that turning recycling off can prevent session state from being lost. Maybe recycle at night at a specific interval? Please advice.

I definitely have to do one of the 3 above. Please advice.

Do you think I should do the below also?

1. Upgrade to Windows Server 2K8. Can anybody comment on how this might help my application.

2. Upgrade to faster machine along with above option and one of options 1-3. Any ideas on which machine I can use


Please help me.

Thanks in Advance.
Posted
Updated 8-Jun-11 3:23am
v4
Comments
aidin Tajadod 7-Jun-11 20:25pm    
Are you using windwos 7 client edition?

for your information, I think it has 10 maximum concurrent connections! (In XP you can increase it to 40, but I am not sure about windows 7) So in the future you won't be able to have 80 users!
[no name] 8-Jun-11 22:33pm    
Thanks. I am looking into using Windows server 2008 r2 standard edition.

1 solution

The whole idea of using a thread per user will lead you nowhere. Not only on ASP.NET application but in networking in general unpredictable or growing number of thread during run-time never make a working software product. You need to radically re-design all you software to have fixed number of threads. This is quite possible. You can have one thread looking for new connections and one more thread reading/writing from/to network stream for all user using round-robin or any other suitable cyclic strategy.

—SA
 
Share this answer
 
Comments
[no name] 8-Jun-11 22:33pm    
I am not using a thread per user really. When a user clicks on the submit button, my application is talking to a server with 36 open ports. I need to be able to do below

SendData(PORT1)ReceiveData(PORT1)SendData(PORT1)ReceiveData(PORT1)upto5 transactions
SendData(PORT2)ReceiveData(PORT2)SendData(PORT2)ReceiveData(PORT2)upto5 transactions
SendData(PORT3)ReceiveData(PORT3)SendData(PORT3)ReceiveData(PORT3)upto5 transactions
SendData(PORT4)ReceiveData(PORT4)SendData(PORT4)ReceiveData(PORT4)upto5 transactions
SendData(PORT5)ReceiveData(PORT5)SendData(PORT5)ReceiveData(PORT5)upto5 transactions
.................................................................................
SendData(PORT36)ReceiveData(PORT36)SendData(PORT36)ReceiveData(PORT5)upto5 transactions


I do need threads to do this if I setup non blocking send and receive i think then it would very difficult to manage and execute and I don't even think it would be efficient in terms of time.

The transactions are very minimal and require low memory and most of the time is spend waiting for data in the threads. Even if all threads are executing, I still have 10 GB left in my server which is not being utilized. Are there like worker threads or some other threads that I can use which is maybe strictly not a 'Thread'
Sergey Alexandrovich Kryukov 8-Jun-11 23:42pm    
What do you mean strictly not a thread? Every given moment of time a piece of code is run in one thread or another. There is no such thing as non-strict thread. So my concern is: what defines how many threads are and at what moment of time all thread are created. Or you create threads all the time (or use them from thread pool)? I would recommend that all thread were created somewhere in the very beginning and never created later during run-time. Same thing about using threads from the thread pool.
--SA
[no name] 9-Jun-11 6:36am    
You are right. I should be using the thread pool class instead of trying to create my own threads.
Thanks!
Sergey Alexandrovich Kryukov 12-Jun-11 18:32pm    
You can do both, it depends how and in what case.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900