"And she vowed a vow and said" (1 Samuel 1:11). Rabbi Yitzhak the Babylonian said: One who vows [in a time of trouble] performs a mitzvah, as it is written, "And Jacob vowed a vow, saying" (Genesis 28:20) — "saying" [is written] for the generations, that they should vow in the hour of their distress; and thus it says, "That which my lips have uttered and my mouth has spoken in my trouble" (Psalms 66:14). Rav said: There are four who vowed; two vowed and profited, and so forth (this is written in remez 68). "And she vowed a vow" — all her doings were in double measure. Her vexation was double: "And her rival also vexed her sorely" (1 Samuel 1:6). Her portion was double: "one portion of two faces" [a double portion] (1 Samuel 1:5). Her weeping was double: "and she wept and wept" (compare 1 Samuel 1:10). Her seeing was double: "if You will surely see" [literally, see-see] (1 Samuel 1:11). Her vow was double: "and she vowed a vow."
Hannah's Vow and the Mitzvah of Vowing in Distress
Yalkut Shimoni on Nach 78:5
ותדר נדר ותאמר. א"ר יצחק הבבללי מאן דנדר [בעת צרה] מצוה דכתיב וידר יעקב נדר לאמר, לאמר לדורות שיהיו נודרים בשעת צרתן, וכה"א אשר פצו שפתי ודבר פי בצר לי. אמר רב ארבעה הם שנדרו, שנים נדרו ונשתכרו וכו' (כתוב ברמז ס"ח). ותדר נדר כל מעשיה בכפלים. כעסה בכפלים וכעסתה צרתה גם כעס. מנתה בכפלים מנה אחת אפים. בכייתה בכפלים ובכה תבכה. ראייתה בכפלים אם ראה תראה. נדרה בכפלים ותדר נדר: