Roger Federer believes he will find consistency at the US Open after being pushed to five sets once again in the second round.

The Swiss great survived a scare in his opening match in New York and was again challenged on Thursday, overcoming an ailing Mikhail Youzhny 6-1 6-7 (3-7) 4-6 6-4 6-2.

It marks the first time Federer, who is aiming to win a third grand slam of 2017, has been taken the distance in the first two rounds of a major in his career.

But the 19-time major champion, who faces Feliciano Lopez in the third round, is confident he will improve as the tournament goes on at Flushing Meadows.

"I might feel more tired than I normally would going into a third round, but that's OK. My preparation hasn't been good at all here," Federer said.

"I knew I was going to maybe struggle early on. Maybe I struggled more than I would have liked to. But I'm still in the draw, which gives me a chance.

"I still believe I'm going to pick up my game and become just more consistent because I'm not playing all that bad. It's just that I'm going a bit up and down in waves throughout the match.

"So clearly I'm happy how I felt after the first round, because that was the scary bit. But that's passed now. Now I can just look forward to play tennis.

"With a bit of fatigue, that's OK. I've done that hundreds of times. That's not something I'm too concerned about. But, sure, perfect would be right now to be in the third round one set up. That's how it would have been in Wimbledon. But I'm stuck in the second round, which is totally fine, too."

Federer's preparations for the year's last grand slam were hampered due to a back injury.

The 36-year-old insisted his back was still improving, but said it had no impact against Youzhny.

"I'm better than the first round, so I'm happy. Yeah, this match wasn't about the back, which is good," he said.

"This is more just a grind. I felt different, completely different, the way it played and everything. But I'm really, really happy I got through."