he Soviet government doubled the price of gasoline and raised the cost of vodka, tobacco and a wide range of other consumer items by up to 40 percent tonight in an apparent move to ease pressures on an increasingly troubled economy.

The increases were explained by Nikolai Glushkov, chairman of the state pricing commission, as having been dictated by "conditions of production, the growing cost of the extraction of raw materials and the need to ensure the rational use of resources and certain commodities."

The prices on basic foodstuffs such as bread, butter and meat were not affected, but the government recently had reinstated a system of informal rationing as a precaution against food shortages expected as a result of this year's poor harvest.

Glushkov also said that prices on some commodities such as synthetic fabrics, underwear, wristwatches, "certain drugs," cosmetics and households goods will be reduced by an average of 12 to 37 percent.

Tonight's announcement came after two days of rumors that sent tens of thousands of Moscow residents on frantic shopping expeditions.

As of Tuesday, the price of high-octane gasoline will be doubled to $2.20 a gallon.

It was the first time the Soviets have taken a step that suggests production difficulties in their oil industry.

The Soviet Union is the world's largest oil producer, averaging about 12 million barrels a day.

The Soviets export more than 3 million barrels a day, more than half of that to other socialist countries.

There was some grumbling today about the announced increases in the prices of alcoholic beverages and tobacco, which range from 17 to 25 percent. The announced 18 percent increase in the price of vodka, the Russian national drink, would bring the cost of a quart to about $14.50. The average monthly salary in the Soviet Union, according to official figures, is $229.

Glushkov said the price increases on alcoholic beverages and tobacco were designed to limit consumption.

Other price increases involve gold, wool, jewelry, cut glass, carpets, furniture, chinaware, fur and leather goods--all up by 25 to 30 percent.

Such luxury items as pleasure boats, gliders and outboard motors were expected to double in price.

Glushkov emphasized that the prices on such staples as bread, sugar, vegetable oil and fish continue at their 1955 levels and that the prices of meat and dairy products have not increased since 1962. He also said that apartment rents remain "the lowest in the world and have not increased for over 50 years."

Nevertheless, the scope of austerity measures and the new price increases seem to inaugurate a new and more difficult period for the population.

Western diplomats here have linked the new austerity measures to the situation in Poland and to the generally increased commitments the Soviets confront throughout their bloc, stretching from Afghanistan to Vietnam and Southeast Asia to Cuba.

The Soviets are also believed to be gearing up for expected new burdens on the economy resulting from defense spending. President Leonid Brezhnev said last week that the Soviet Union intends to match any new weapons system produced by the United States.

The tone of Soviet propaganda coupled with the new economic measures leaves a distinct impression here that the government is trying to prepare the population for a period of uncertainty and difficulties.

Well-informed sources said party members have been told in closed meetings that all these precautionary measures were necessary to counter hostile policies of the Reagan administration, whose aim is described as wanting to run the Soviet economy into the ground by embarking on a new round of the arms race.

This year's grain harvest is now expected to yield no more than last year's disappointing 190 million tons. It will be the third year in a row that the Soviets will be between 40 million and 50 million tons short of their 1978 harvest of 236 million tons.