The prospect of closing one of Edinburgh's two main stations during major events has been raised by Scotland's Railway managing director Alex Hynes.
He told MSPs today: "Is it wise to keep Waverley and Haymarket open at the same time?"
Mr Hynes, who heads ScotRail and Network Rail Scotland, was reacting to the huge disruption on Saturday 24 August when thousands of people swamped Waverley after the Scotland v France rugby international at Murrayfield on the final weekend of the Edinburgh Festival.
He told the Scottish Parliament's rural economy and connectivity committee: "I'm not sure it is wise for us to host rugby at Murrayfield at the same time as the busiest Edinburgh Festival weekend.
“So it’s clear to me we’re going to have to manage this risk in a different way."
Mr Hynes said he was already starting talks over this with Scottish Rugby.
He said "quota controls" might be needed on the busiest days.
Mr Hynes said ScotRail was continuing to get more trains, but the Festival was also "only going to get bigger".
He said that despite having more carriages available than ever before, the number available on 24 August was "not sufficient" to accommodate the number of people who wanted to travel at the same time.
“We took many people into Edinburgh and clearly the numbers of people who wanted to travel back at the same time created some pressure on the system.
"We let our customers down."
Mr Hynes said part of the disruption had been caused by passenger alarms being activated three times, which brought the trains to a halt.
He said an "incident learning review" had been ordered, whose "learnings" would be published.
“The learnings won’t just affect the railway, the learnings will also affect major event management in the city of Edinburgh because these events are getting bigger and bigger.
“We operate a walk-up railway and that presents some logistical challenges and so one of the things we need to think about is do we actually put quota controls in on those very, very busy days?
“These are all things that we’re thinking about because the Edinburgh Festival is only going to get bigger so we might need to adapt our operation accordingly.”
A ScotRail spokesperson said later: “Major events in Edinburgh and across Scotland are getting bigger and bigger, and together with industry partners we need to look at how these events are managed.
“We’re conducting an incident learning review following disruption in Edinburgh at the end of August to see how we can better manage large scale events.”
The train operator said quota controls could include special trains, ticket types and their availability and restrictions such as day and time of travel.
A Scottish Rugby spokesman said: “Scottish Rugby hosts summer test matches every four years as part of the Scotland’s team’s preparations for the Rugby World Cup and, as such, the dates and times are known well in advance to all partners, creating ample time to flag and discuss any concerns, which for this year’s games none were received.
“Scottish Rugby announced details of this summer’s test matches in November 2018 and the kick-off times in May.
"ScotRail were among the transport and public safety partners we work with for every match to ensure our supporters have a safe, enjoyable day and can attend BT Murrayfield using a variety of transport options.
"The match versus France on 24 August kicked off at 1:10pm and the stadium was empty by 4pm.”