Bangladesh is being forced to cut power to millions of people as a relentless heatwave brings a surge in demand for power causing electricity supply shortfalls during the Muslim fasting month of Ramadan.

Greater use of irrigation pumps by farmers and an increase in commercial activity during Ramadan have contributed to increased power demand, officials say.

"It's difficult for us to sleep at night without power, and it is even more painful after fasting all day," said Munna Khan, a resident of the town of Ashulia on the outskirts of the capital, Dhaka.

Power shortages have been most severe at night, government data showed. The port city of Chittagong, along with the textile, pharmaceutical and jute manufacturing hub of Mymensingh, have been among the worst-affected places.

The power cuts could increase production costs for Bangladesh's important export-oriented garment industry, which supply to customers such as Walmart, Gap Inc, H&M, VF Corp, Zara and American Eagle Outfitters, industry officials say.

"We'll need more diesel to run the captive power plants to continue our production. That will raise production costs, but the buyers will not pay more," Shahidullah Azim, vice president of the Bangladesh Garment Manufacturers and Exporters Association told Reuters.

The average maximum temperature in Dhaka was 4.3% higher during the seven days to Wednesday compared with the week before and 12.5% higher than the same period last year, government data showed.

The maximum temperature soared to 42.8 Celsius (109 Fahrenheit) on Wednesday in the west of the country.

"People, especially children and the elderly, are suffering a lot. We express our sincere sympathy and sorrow for this untold suffering," Minister of Energy Nasrul Hamid said in a Facebook post late on Tuesday.

Hamid said the heatwave was "unprecedented" and the weather office has warned that there is no end in sight as the country prepares for the Eid al-Fitr holiday at the end of Ramadan this weekend.

Overall electricity supply fell short of demand by 6.6% over the seven days to Wednesday, government data showed, as demand surged nearly 14% compared with the preceding seven days.

Neighbouring India is also seeing extreme heat, surging demand for power and some shortages.

India recorded a peak power demand - a measure of maximum power requirement during the day - of 215.9 gigawatts (GW), with the government a rise to as much as 229 GW this month.

(Additional reporting by Matthew Chye; Editing by Robert Birsel)