English 中文(简体)
WCF的应急管理
原标题:Concurrency management in WCF

i have implemented a fairly simple wcf service which handles the file transfers from my clients to the server the problem is when a client sends a file request. all of the bandwidth is allocated to that single client and others have to wait until the requested file transfer is completed. So my question is how to make the service more efficient and let the users share the bandwidth

[ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode =InstanceContextMode.PerCall,
    ConcurrencyMode=ConcurrencyMode.Multiple)]

我把ContextMode归PerCall,但那是 t的。

UPDATE : This Project is similar to mine http://www.codeproject.com/Articles/33825/WCF-TCP-based-File-Server

最佳回答

值得怀疑的是,最好通过世界妇女论坛终端点来提供档案。 这样做的原因恰恰是你面临的问题。 该公司在一段时间内为少数客户服务,但缩小规模需要为负荷平衡者提供新的服务。

值得考虑的是,将你的档案存放在某种储存服务处,而你的周转基金服务只是归还链接或处理档案。 然后可以从网上取回档案。 微软为此创建了Azure Blab Deposit

赞赏这一点没有解决你原来的问题,理解你的要求范围可能无法进行大范围的调整。

问题回答

WCF does not have proper load balancing, you will have to develop one yourself. If you are transferring files, lets assume download, you should send packets of data rather than the complete file at once. When doing this, add delays/sleeps to the process to limit the amount of bytes the server sends on each time window, this will make room for other requests.

另一种选择是,如果你转让大型档案,则使用剪辑渠道。 例如:,

Although I agree with @hugh position.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签