I'm not a medical doctor.
Personally the combination of B12 and L-Lysine has kept my canker sores to being very infrequent. And when I get them, they are painful for less than 2 days. I also apply cankershield, just to be sure. It would be interesting to experiment trying only one (B12 vs Lysine) and not the other, but being a sufferer myself and finding that this combination seems to work, I'm not willing to try :)
FWIW, I did Googled for research papers on Lysine and Canker Sores (aka Apthous Ulcers) and one study suggested that it does work:
Also, a bottle of L-Lysine by NatureMade (Amazon Link) is $7.50USD when I looked it up. Not bad for a 2 month supply. This is the brand I've been using
Nature Made Extra Strength L-Lysine 1000 mg Tablets, 60 Count for Protein Synthesis https://www.amazon.com/dp/B0000DJAR5/ref=cm_sw_r_apan_i_M40V99K2ZJS367ARZ381
I usually find it at every grocery store