The larvae of most species feed on fungi growing on soil, helping in the decomposition of organic matter. However some species are predatory, including those in the genus Arachnocampa of family Keroplatidae – the "glowworms" of Australia and New Zealand. The adults are long, and are occasionally pollinators of plants and carriers of mushroom spores. They also may carry diseases such as pythium on their feet. Most fungus gnats are weak fliers, and can often be seen walking rapidly over plants and soil, rather than flying. However when airborne, the gnats may be quite annoying to humans by flying into their faces, eyes, and noses, both indoors and outdoors. These flies are sometimes confused with drain flies.
Hardiness
Some fungus gnats are exceptionally hardy, being able to tolerate cold conditions through their possession of antifreeze proteins. Typically, overwintering organisms can either avoid freezing or tolerate freezing, but Excechia nugatoria can do both. For E. nugatoria, the production of noncolligative antifreeze proteins protects the head and thorax from freezing, but they do not protect the abdomen. Freezing of the head and thorax in other insects tends to have adverse effects on neural tissue, so it is not surprising that these protective mechanisms have been observed in certain species, but E. nugatoria is the only insect known to semi-freeze through the winter. By allowing the abdomen to freeze, evaporative water loss is reduced over the course of the winter.
Management
Fungus gnats in the family Sciaridae may be pests. They are typically harmless to healthy plants - and humans - but can inflict extensive damage to seedlings; their presence can indicate more serious problems. In houseplants, the presence of sciarids may indicate overwatering; they may be feeding on roots that have been immersed in water too long and are thus rotting, or the gnats may be attracted to fungus growing in saturatedtopsoil. Consequently, allowing the soil to dry may reduce their numbers. The pests are sometimes also managed by placing a layer of sand or indoor mulch on top of the soil around plants; by introducing Hypoaspis miles mites or applying the biological larvicide Bacillus thuringiensis to kill gnat larvae; by drenching the soil annually in an insecticidal soap. Hydrogen peroxide can be mixed with water and used to kill fungus gnat larvae in infected soil with a mixture of one part 3% hydrogen peroxide mixed with four parts water, then applied to the soil. Adults can be trapped with yellow sticky traps made of yellow card stock or heavy paper coated in an adhesive since the adults are attracted to the color yellow. Since the gnats are weak fliers, fan-based traps as well as other fly-killing devices may be used to help control free-flying gnats, especially indoors. There are a number of toxic and non-toxic methods of controlling sciarids and their larvae, including nematodes, diatomaceous earth, or powdered cinnamon. Commercial greenhouses typically employ the insect growth regulatordiflubenzuron for control of fungus gnats and their larvae. It is applied to infected soil and will kill fungus gnat larvae for 30–60 days from a single application. Its mechanism of action is to interfere with chitin production and deposition and it also triggers insect larvae to molt early without a properly formed exoskeleton, resulting in the death of the larvae. Although it is targeted at fungus gnat larvae, care should be taken in applying it as it is highly toxic to aquatic invertebrates. Diflubenzuron typically has no toxic effect on adults; only the larvae are affected.