hook_form_alter not running if cache enabled
Messages set by drupal_set_message() goes thorough message router and may end up displayed on another page than the one you set them. If you want to add informative element to your form, use markup Form API element instead.

if($form_id == "user_profile_form" &amp;&amp; $user-&gt;uid == 1) {
  $userid = arg(1);
  if(is_numeric($userid)) {
    $form['info'] = array(
      '#markup' =&gt; t("Current User Id on site: !uid", array('!uid' =&gt; $userid)),
      '#weight' =&gt; -9999,
    );
  }
}