The main function of the windsock is to show from which direction the wind blows. The faster the wind blows, the straighter and more horizontally the wind extends.
As per FAA standards a 15-knot (28 km/h; 17 mph) wind will fully extend the properly functioning windsock. A 3-knot (5.6 km/h; 3.5 mph) breeze will cause the properly functioning windsock to orient itself according to the wind. If the windsock has blown away, the wind is greater than the 75 knot design limit.
http://www.faa.gov/documentLibrary/media/Advisory_Circular/150_5345_27e.pdf
Windsocks are accurate only within a small radius. In those airports where there is only one windsock and it's alongside the midpoint of the runway, the only thing of which you can be certain , is that, the wind at either end of the runway will NOT necessarily match. This explains why many airports have windsocks at both ends of the runway. The sock in the middle tells traffic which runway to use, but the windsock at the end of the runway tells the pilot what to expect on approach.
Note that the correspondence between wind speed and degree of extension and straightening will varies from one model to another. You can calibrate the windsock with the help of a anemometer.
After installing the windsock on the ground , use the anemometer to calibrate the shape and orientation of the windsock to specific wind speeds. The anemometer (wind meter) should be held at the same height as the windsock’s larger opening . Point it into the wind and record the wind speed reading.