|
 |
 |
 |
|
Author: |
Travis Whidden |
Created: |
5/13/2007 9:53 PM |
 |
|
Ramblings from a computer nerd slash car guy. |
By Travis Whidden on
7/20/2009 8:40 PM
For many years, I have though that all items served out of IIS would be compressed if you enabled the IIS option to compress static and dynamic files. Unfortunately I was wrong. You actually have to tell IIS what files you want to serve out compressed. I actually came across this while looking for a solution to compress my WCF elements. Some of the datasets that I was returning were upwards of 500kb. On a slower connection, that just is not going to work. Once I enabled this option, requests that were 500kb were 12-20kb. That's a huge performance increase. I tested at different site, and found there to be a huge performance increase. In one spot, a 128k frame system sending these reports took 17 seconds. After the fix, took only 3 seconds. I must note that your WCF services that are hosted through IIS must be marked with the [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
(or enabled via the web.config). I'm not positive on that requirement, but that's how I understand it.
So, to enable this wonderful option: CSCRIPT.EXE C:\Inetpub\AdminScripts\ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "svc" "aspx" "asmx"
CSCRIPT.EXE C:\Inetpub\AdminScripts\ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "svc" "aspx" "asmx"
CSCRIPT.EXE C:\Inetpub\AdminScripts\ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel 9
CSCRIPT.EXE C:\Inetpub\AdminScripts\ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel 9
Then restart IIS - your golden.
I hope this helps. I spent about 3-4 hours trying to write my own WCF channel with worries about compatibility with non .net clients such as J2EE. I had may different options working but each had their downside (special client requirements). This is the best way I feel, as it allows the client to specify if they support GZIP or DEFLATE and if they don't, well, they can have the raw data.
Maybe a future version of WCF will support a gzip binding for wcf natively. For now, there is IIS which seems to do just fine.
|
By Travis Whidden on
7/13/2009 9:25 AM
Vonage has been very reliable to our companies over the past couple years. We have 4 sip trunks through them. Today however we were getting 1500 ms response times to the Vonage sip server they had us using (sphone1.voncp.com). This is totally unacceptable in a VOIP environment. Our Asterisk server would not work at this point. After about 2-3 hours on the phone this morning, I convinced the Level3 Vonage techs to give me an alternate address to try (it took 2-3 hours to get to the L3 guy.. I was on the phone with the L3 guy for 10 minutes). The IP (var1.voncp.com) worked like a champ. They are doing some kind of DNS round-robin or something to rotate the IPs for load balanncing, so it rotates between different IP address's. I found that one of them had < 20 ms response times from my datacenter. I talked to the Vonage L3 tech, and he said there is no problem if I wanted to use just that one IP instead of a DNS name. So, if you are having some latency problems with Vonage, ping var1.voncp.com several times until you get an ip that has a low latency, and configure your server (I'm using trixbox asterisk) with that IP. Here are some of my results: [root@trixboxxxxxxx asterisk]# ping var1.voncp.com PING var1.voncp.com (69.59.252.178) 56(84) bytes of data. 64 bytes from proxy-var-outbound-01b.kewr0.s.vonagenetworks.net (69.59.252.178): icmp_seq=0 ttl=53 time=85.0 ms 64 bytes from proxy-var-outbound-01b.kewr0.s.vonagenetworks.net (69.59.252.178): icmp_seq=1 ttl=53 time=84.4 ms 64 bytes from proxy-var-outbound-01b.kewr0.s.vonagenetworks.net (69.59.252.178): icmp_seq=2 ttl=53 time=85.2 ms --- var1.voncp.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 84.777/84.803/84.830/0.292 ms, pipe 2 [root@trixboxxxxxxxx asterisk]# ping var1.voncp.com PING var1.voncp.com (69.59.227.134) 56(84) bytes of data. 64 bytes from proxy-var-outbound-1c.klga1.s.vonagenetworks.net (69.59.227.134): icmp_seq=0 ttl=47 time=94.9 ms 64 bytes from proxy-var-outbound-1c.klga1.s.vonagenetworks.net (69.59.227.134): icmp_seq=1 ttl=47 time=94.8 ms --- var1.voncp.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 95.820/95.820/95.820/0.000 ms, pipe 2 [root@trixboxxxxxxxx asterisk]# ping var1.voncp.com PING var1.voncp.com (69.59.240.64) 56(84) bytes of data. 64 bytes from proxy-var-outbound-1a.klax2.s.vonagenetworks.net (69.59.240.64): icmp_seq=0 ttl=55 time=23.6 ms The ONLY caveat to this whole thing, is you will have to get to a L3 Support team so they can update some XML files in their system that tell inbound calls how to route to your system. Mine worked right away, but some other Vonage numbers that we had forwarded to that inbound sip didn't work at all. After they updated their servers (took only minutes), everything was fine. I hope this helps some of you Vonage sip trunk subscribers. They really do have a fantastic service. We bought our sip trunks from http://www.asterisk-vonage.com/ $175 a month for unlimited in, 5000 out, and unlimited simultaneous calls on one sip trunk (many providers do not allow this). Nice not to have to worry about a roll over ;)
|
By Travis Whidden on
6/16/2009 6:05 PM
We have been diving deep into WCF lately. WCF is very nice to use, and a great alternative to web services. One of the things we are doing is dynamic WCF services where services can be created at run time of the web application (highly modified version of BinaryCoder's source listed on the MSDN website). Anyhow, we are making reference to WCF interfaces that are hosted via IIS, and not wanting to generate the dirty proxy code that you need to do with web services. This is a great snippet - the original is: http://blog.weminuche.net/ Our changes were to fit our design, which was a different constructor where we passed the URI of the service, and the receive message size because some of the data results that were passed back were larger then the default window.
/// <summary>
/// Generic Service Proxy for WCF - Connect to a URI/L with a type interface.
/// </summary>
/// <typeparam name="TInterface"></typeparam>
public class ServiceProxy<TInterface> : ClientBase<TInterface>, IDisposable where TInterface : class
{
#region Delegates
public delegate void ServiceProxyDelegate<T>(TInterface proxy);
#endregion
public ServiceProxy()
: base(typeof (TInterface).ToString())
{
}
/// <summary>
/// Pass the URI directly to the constructor.
/// </summary>
/// <param name="uri"></param>
public ServiceProxy(string uri)
: base(new BasicHttpBinding(){MaxReceivedMessageSize = int.MaxValue}, new EndpointAddress(uri))
{
}
public TInterface Proxy
{
get { return Channel; }
}
#region IDisposable Members
public void Dispose()
{
if (State == CommunicationState.Faulted)
{
base.Abort();
}
else
{
try
{
base.Close();
}
catch
{
base.Abort();
}
}
}
#endregion
protected override TInterface CreateChannel()
{
return base.CreateChannel();
}
public static void Call(ServiceProxyDelegate<TInterface> proxyDelegate)
{
Call(proxyDelegate, typeof (TInterface).ToString());
}
public static void Call(ServiceProxyDelegate<TInterface> proxyDelegate, string endpointConfigurationName)
{
var channel = new ChannelFactory<TInterface>(endpointConfigurationName);
try
{
proxyDelegate(channel.CreateChannel());
}
finally
{
if (channel.State == CommunicationState.Faulted)
{
channel.Abort();
}
else
{
try
{
channel.Close();
}
catch
{
channel.Abort();
}
}
}
}
}
Usage is very simple: using (var client = new ServiceProxy<IModuleServices>(someURI))
{
var md = client.Proxy.ModuleDetailsGet(packet.UserSession.SessionID, packet.ModuleInstalledID);
return md.ReturnValue;
}
|
By Travis Whidden on
5/14/2009 3:58 PM
This tutorial will show you how to accept multicast traffic on a specific adapter. Windows NT doesn't allow for Multicast traffic on a multi-homed system on all adapters - only the first one to boot. This is a problem for people who have applications that require multiple networks but need multicast on a specific network. In my field of work, this happens in surveillance systems where many NVR/DVR providers multicast packet delivery to hosts. The FASTEST way to get multicast traffic is to plug the Ethernet cable that will contain the multicast traffic into the first network adapter on your server. This tutorial is going to show you how to switch the boot priority of the Ethernet without the need to be onsite, without having to modify the registry manually, without having to use RAS (Routing and Remote Access). Open up your network connections. You should see something like this: Quick Command: Start->Run->ncpa.cpl Notice how my network named "Pelco" network was listed second. This is because someone plugged the cable into port 2 on the server. Unfortunately, Port 2 now is the adapter where multicast traffic will come from. To change the boot priority so that the "Pelco" network boots first, click on that "Advanced" tool bar option. (I know, I never noticed it there before ether). Click "Advanced Settings" Now, Change the Adapter and Bindings - the top most item boots first, and next down the line boots next: Now, I am not sure if its needed or not, but the boot priority seems like I would need to reboot it. Maybe they don't call it "boot priority" but, that's how I look at it. Once you reboot, you should now be getting Multi-cast traffic on that first adapter (well, 2nd adapter made to boot first). Happy Multi-casting!
|
By Travis Whidden on
12/29/2008 10:45 AM
Example of using the ContentControl - it squeezes the content down to its minimum size. I am sure there is a solution, just need to find out how/what

Note, this is just a tester app. I am using the Content Control dynamically in my real application.
|
By Travis Whidden - Family User on
9/9/2008 7:06 AM
We got a chance to fire a friends BMG 50 cal sniper rifle. What a gun. The concussion around us was amazing. However, there was a slight defect in the stock, and it was collapsing on us.. resulting in some damage to our faces :)
|
By Travis Whidden - Family User on
9/8/2008 8:01 AM
Yea, so last year we went shooting, and I got to fire my buddies 50 cal revolver. It was absolutely retarded, but the video is actually funny when you play it back at 1/4 speed. Almost hits me in the face.
|
By Travis Whidden on
8/23/2008 7:20 AM
wow.. just wow.
|
By Travis Whidden on
8/20/2008 6:46 AM
Just nuts.
|
By Travis Whidden on
8/13/2008 6:58 AM
Yea, ummm... I am down with this.  I just put in a Cisco 3640 router with several FastEthernet ports. Going to use my Cisco 806 at my office. I pay for the top tier service from Cox, but my mom and father in law have the low service and they get these same speeds? Well, I am still very happy with this. Maybe one day, we will have 100/100 speeds.. or even better 1000/1000 speeds! Travis
|
|
|
|
|
 |
 |
 |
 |
|
|
|
|