Is there any benefit applying before the deadline? From what I have seen, academic position usually have 1-2 months deadline.
I know that for non-academic positions if a suitable candidate is found, the position may be filled in advance.

Does applying one month or some weeks before give particular advantages? Is it risky to apply close to the deadline?
Surely country dependent. For Germany: There is no difference in applying early or just in time. The review process for all applications does not start before the deadline is passed. I you are one day late you may or may not be considered - I think more often than not you application will not be considered if too late.